Skip to content

Regression vs Classification: Choosing a Machine Learning Task

Distinguish numeric prediction from category prediction, define the target carefully, and build a baseline before choosing a model.

Part of Data Science & Machine Learning Course

Supervised learning uses examples with known outcomes. The target determines whether a task is usually framed as regression or classification, but the task definition should come from the real question rather than the model library.

Regression predicts a numeric value

Examples include estimating a duration or quantity. Check the target's unit and range, inspect outliers, and select an error measure that is interpretable for the task.

Classification predicts a category

Examples include assigning one of several labels. Check class balance and explain what each label means. Accuracy alone can be misleading when one class is much more common than another.

Build a baseline

Compare a model with a simple reference, such as predicting a central value or the most frequent class. A baseline reveals whether added complexity improves the chosen metric.

Check timing and leakage

Only use features that would be available when a prediction is made. Fields created after an outcome can leak the answer into training. A strong score caused by leakage is not evidence of a useful model.

Keep learning

Data Science & Machine Learning Course course Supervised Machine Learning: Regression and Classification guide