Despite the name it is a classifier — built by passing a linear score through the sigmoid so the output lands in (0,1) and reads as probability.
It trains on log-loss, which punishes confident wrong answers brutally; accuracy is computed after, at whatever threshold you pick.
The default 0.5 threshold is not sacred: a kitchen that fears burnt food moves it down, trading false alarms for safety.
Coefficients live in log-odds: each extra minute multiplies the odds of burnt by e^w.
In the Test Kitchen: minimise the log-loss by hand with two sliders — then appreciate what the optimiser does in milliseconds.
Don't just read the recipe — taste it. Drag, click and break things below.
Dots on the floor are golden pakoras (0), dots on the ceiling are burnt ones (1). The purple S-curve is your model's p(burnt). Slide the midpoint and steepness to push the log-lossas low as you can — you are doing, by hand, exactly what logistic regression's optimiser does.
FIG L.5: LOGISTIC REGRESSION — σ(k(t−m)) MAPS FRY TIME TO PROBABILITY; THE BOUNDARY SITS WHERE p = 0.5
from sklearn.linear_model import LogisticRegression import numpy as np X = np.array([[1.2],[2.4],[3.6],[4.6],[5.2],[5.9],[7.0],[8.4]]) y = np.array([0, 0, 0, 1, 0, 1, 1, 1]) # burnt? clf = LogisticRegression().fit(X, y) print(clf.predict_proba([[5.0]])[0, 1]) # p(burnt) at 5 minutes # boundary = where p = 0.5, i.e. w·t + b = 0: print(-clf.intercept_[0] / clf.coef_[0, 0]) # ≈ the safe fry time