Logistic Regression and Classification
Why a straight line cannot model a probability, how the logistic function fixes it, and what the coefficients mean in log-odds, with a gradient-ascent step and a converged fit computed and checked numerically.
Move a parameter along the log-likelihood curve of a fixed sample and watch the fitted distribution track it, with the peak sitting exactly at the maximum-likelihood estimate.
A fixed sample of 40 observed event counts.
Maximum likelihood asks: which λ makes the observed data most probable? Slide λ and the log-likelihood climbs to a single peak, dead on the sample mean (1.55), and the fitted bars snap onto the observed frequencies there. Every GLM on this site is this same climb, just in more dimensions.
Runs entirely in your browser. Nothing you enter is uploaded or stored.
Why a straight line cannot model a probability, how the logistic function fixes it, and what the coefficients mean in log-odds, with a gradient-ascent step and a converged fit computed and checked numerically.
Derive the least-squares coefficients by differentiating the residual sum of squares, then work a complete five-observation fit by hand: coefficients, fitted values, residuals, RSS, and R-squared, each verified numerically.