The core supervised model families
coreintermediateLinear regression predicts a number as a weighted sum of features. Logistic regression predicts a probability for classification. A decision tree splits data by asking a sequence of yes/no questions. A random forest averages many trees. Gradient boosting builds trees one at a time, each correcting the last one's errors. Nearest neighbors predicts using the most similar training examples.
Think of it as
These six models split into two families with very different behavior. Linear regression and logistic regression are linear models: fast, interpretable (each feature's weight says how much it matters and in which direction), and correct only if the true relationship really is close to linear in the features you gave it — they need you to do the nonlinear work yourself, often through feature engineering. Decision trees, random forests and gradient boosting are tree-based models: they split on thresholds, so they need no scaling, capture nonlinear relationships and feature interactions automatically, and are usually the strongest choice for structured tabular data. A single decision tree overfits easily; a random forest averages many trees trained on random subsets of data and features, trading a little bias for much lower variance; gradient boosting builds trees sequentially, each one targeting the previous ensemble's errors, which usually reaches higher accuracy than a random forest but is more sensitive to hyperparameters and easier to overfit if not tuned. Nearest neighbors is neither — it does no real 'training' at all, just stores the data and, at prediction time, looks up the closest stored examples; simple and interpretable, but slow to predict on large datasets and sensitive to feature scale.
What we're doing: Compare four model families on the same tabular classification problem to see the trade-offs in practice.
- 8
- Logistic regression usually trains fastest here, and its accuracy is a useful baseline — if a tree-based model barely beats it, the relationship may genuinely be close to linear.
- 10
- Gradient boosting typically reaches the highest accuracy on structured tabular data like this, at the cost of a longer training time and more hyperparameters worth tuning.
- 15
- k-NN's "training" time is nearly instant — it just stores the data — but its prediction time grows with dataset size, which this loop does not even measure separately.
Why this works: No single model wins universally — the honest way to choose is to actually compare a small, representative set on the real data, because the theoretical trade-offs (linear vs nonlinear, interpretable vs accurate, fast-train vs fast-predict) only tell you the shape of the decision, not which model wins on this specific dataset.
Choosing a model family from its reputation instead of comparing it on the actual data
Wrong
Better
What you see: A team spends significant tuning effort on a gradient boosting model that ends up barely outperforming a five-line logistic regression baseline that was never tried — reputation, not measurement, drove the choice.
Why: A model family's general reputation comes from its behavior across many datasets; any single dataset can be the exception — small, close-to-linear, or too small for a complex model to have an advantage. A cheap baseline comparison catches this in minutes; skipping it can cost days of tuning a model that was never the right choice.
Six models, compared on four practical axes
Remember: Linear/logistic regression: fast, interpretable, assumes near-linearity. Trees/forests/boosting: capture nonlinearity automatically, no scaling needed, boosting usually wins accuracy but is most hyperparameter-sensitive. k-NN: no real training, slow at prediction time, scale-sensitive. Compare on the real data — reputation is not a substitute for a baseline.
See also: ml task types · model tradeoffs and assumptions · classification metrics





