siddhant

Knowledge / Machine Learning

Linear Models

The fundamental family of regression and classification models built from linear combinations of features.

By Siddhant Krishna · Published 2026-10-06 · Updated 2026-10-06

01

Linear regression

Linear regression predicts a continuous target from a weighted sum of features. In matrix notation, predictions are Xθ. With squared error, the objective has a closed-form solution under appropriate rank conditions.

θ̂ = (XᵀX)⁻¹Xᵀy

In practice, numerical solvers are preferred to explicitly computing the inverse because they are more stable and can scale better.

02

Logistic regression

Logistic regression maps a linear score through the sigmoid function to produce a probability-like quantity for binary classification. Despite its name, it is a classification model rather than a regression model.

The decision boundary remains linear in the feature space, but the probabilistic output makes the model useful for ranking, threshold selection and uncertainty-aware decisions.

03

Regularization

Ridge:  loss + λ||θ||²₂
Lasso:  loss + λ||θ||₁

Ridge regularization shrinks parameter magnitudes, while L1 regularization can drive some coefficients exactly to zero. Regularization expresses a preference for simpler parameterisations and can improve generalization.

04

Geometric interpretation

A linear classifier separates feature space using a hyperplane. The orientation of the parameter vector determines the direction of the boundary, while the bias term determines its offset.

This geometric perspective connects linear models to support vector machines, large-margin learning and the representation-learning problem: nonlinear features can make a problem linearly separable in a transformed space.

References

  1. Stanford University, CS229 Machine Learning. Course materials covering supervised and unsupervised learning, learning theory, regularization, SVMs and reinforcement learning.
    https://cs229.stanford.edu/
  2. Gareth James, Daniela Witten, Trevor Hastie, Robert Tibshirani and Jonathan Taylor. An Introduction to Statistical Learning.
    https://www.statlearning.com/

Related

Contact

Get in Touch

Want to chat? Just shoot me a dm with a direct question on twitter and I'll respond whenever I can. I will ignore all soliciting.