How to choose an algorithm

Before picking an algorithm, ask one question: what kind of answer do I need? A number, a category, a group, or the best action? That narrows the choice to a few algorithms, and then you test which works best on your data.

Everyday analogy

Choosing transport: a short trip in the city? Auto. Across the country? Train or flight. Carrying furniture? A tempo. The journey decides the vehicle; the problem decides the algorithm.

Example

"How many units will we sell next week?" needs a number (regression). "Will this customer leave?" needs a category (classification). "Which customers are alike?" needs groups (clustering).

What answer do you need?A numberLinear regressionRandom forestA categoryLogistic regressionDecision treeGroupsK-meansDBSCANBest actionsQ-learning
Start from the kind of answer you need, then pick an algorithm family.

Predict a number

Regression

Linear regression · Gradient boosting · Random forest · Neural networks

Choose a category

Classification

Logistic regression · Decision tree · Random forest · Naive Bayes · SVM · KNN

Find groups

Clustering (no labels)

K-means

Learn the best actions

Reinforcement learning

Q-learning

Images, speech, language

Very complex patterns

Neural networks and deep learning

Need to explain every decision?

Prefer simpler models

Linear / logistic regression · Decision tree

Try it yourself

About 10 min

Name the problem type

  1. Write 6 business questions (sales forecast, churn, customer groups, fraud, price, next product).
  2. Label each: regression, classification, clustering or recommendation.
  3. Pick one algorithm from this page for each.

What you should see: Choosing an algorithm starts with the kind of answer you need.

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

Build it for real · guided projectYour first machine learning model: predict house pricesAbout 75 min · Copy-paste code · step by step
Test what you learned

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