Machine learning algorithms cheat sheet: 17 side by side

This page puts the most common machine learning algorithms side by side: what type of learning they use, what they are best at, what to watch out for, and a real example. Use it to revise, or to narrow down your choice before you dig deeper.

Everyday analogy

A menu with short notes next to each dish: good for, not good for, popular with. You still taste the dish before deciding, but the menu saves you time.

Example

You need to group shoppers but the groups are oddly shaped and some customers are one-offs. The table points you away from K-means (round groups) and towards DBSCAN, which handles odd shapes and labels one-offs as noise.

📈Regressionlinear, gradient boosting🏷️Classificationlogistic, tree, SVM, KNN🫧Clusteringk-means, DBSCAN🗜️DimensionsPCA, autoencoders🖼️ImagesCNN💬Languagetransformers
The algorithm families at a glance.
AlgorithmTypeBest forWatch out forReal example
Linear regressionSupervisedPredicting a numberOutliers and curved patternsHouse prices
Logistic regressionSupervisedYes/no decisionsVery curved boundariesSpam or not spam
Decision treeSupervisedEasy-to-explain decisionsOverfitting, small changes flip itLoan approval
Random forestSupervisedAccurate, robust predictionsSlower, harder to explainFraud detection
Gradient boostingSupervisedTop accuracy on tables of dataNeeds careful tuningCredit scoring
SVMSupervisedClear separation, many featuresSlow on large, noisy dataFace recognition
KNNSupervisedSimple “similar items” lookupsSlow and noisy with many featuresRecommendations
Naive BayesSupervisedFast text classificationFeatures that depend on each otherSentiment analysis
K-meansUnsupervisedSplitting into round groupsYou must choose K; odd shapesCustomer segments
Hierarchical clusteringUnsupervisedA family tree of groupsVery large datasetsGrouping genes or products
DBSCANUnsupervisedOdd-shaped groups, spotting outliersGroups of very different densityMap hotspots
PCADimensionality reductionSqueezing many columns into a fewResults are hard to interpretImage compression
Neural network (MLP)SupervisedComplex patternsNeeds lots of data and tuningImage classification
CNNSupervisedImages and videoHeavy computing; not for text sequencesSelf-driving vision
RNNSupervisedSequences over timeLong sequences (forgets early parts)Stock or sensor trends
Transformer (BERT, GPT)Self-supervisedLanguage, chat, translationVery costly to train and runChatGPT, Claude
AutoencoderUnsupervisedCompression, spotting unusual casesCan overfit; a black boxFraud and anomaly alerts

Three new names in this table: Hierarchical clustering builds a tree of groups inside groups. DBSCAN finds dense crowds of points and calls lonely points noise. Autoencoders learn to squeeze data and rebuild it, so anything they rebuild badly is probably unusual.

Try it yourself

About 10 min

Quiz yourself on the table

  1. Cover the Best for column with paper.
  2. For 5 algorithms, say out loud what each is best for, then check.
  3. Pick the two you mixed up and reread their lessons.

What you should see: Quick self-testing fixes the cheat sheet in your memory.

Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.

Build it for real · guided projectFind customer groups with K-means clusteringAbout 45 min · Copy-paste code · step by step
Test what you learned

Take a quick quiz, or look up any word in the glossary.