What is the difference between a classification and a regression problem? For each, name a typical loss function used for training and two evaluation metrics. Is logistic regression a regression algorithm?
Show hints
Look at what kind of value the model outputs.
Show the explanation
Model answer. Both are supervised learning — the model learns from labelled examples — but they differ in the type of target.
Regression: predict a continuous number
- Examples: house price, tomorrow's temperature, a student's expected exam score.
- Training losses:
- Mean squared error (MSE): average of squared errors; penalises large errors heavily.
- Mean absolute error (MAE): less sensitive to outliers.
- Huber loss: behaves like MSE for small errors and MAE for large ones.
- Evaluation metrics: RMSE (same units as the target), MAE, and R² (fraction of variance explained relative to predicting the mean).
Classification: predict a category
- Examples: spam vs not spam (binary), digit 0–9 (multi-class), tags on a photo (multi-label).
- Training loss: cross-entropy (log loss), which compares predicted probabilities with the true label and heavily penalises confident wrong predictions. Models usually output probabilities via a sigmoid (binary) or softmax (multi-class).
- Evaluation metrics: accuracy, precision, recall, F1 score, ROC-AUC, and the confusion matrix. With imbalanced classes, accuracy alone is misleading.
Is logistic regression regression?
No — despite the name, it is a classification algorithm. It computes a linear combination of features and passes it through the sigmoid to output a probability between 0 and 1; a threshold (often 0.5) turns that into a class. The "regression" in the name refers to modelling the log-odds as a linear function of the inputs.
Some algorithms do both: decision trees, random forests, gradient boosting, k-nearest neighbours and neural networks have classification and regression versions; only the output layer, loss and leaf/aggregation rule change.
Common follow-up: "Predicting a movie rating from 1 to 5 stars — classification or regression?" It is ordinal: you could treat it as regression (and round), as classification (losing the order information), or use ordinal regression methods. A good answer explains the trade-off rather than picking one blindly.
Original UniCircle question. Last reviewed 28 Oct 2026.
