Skip to content

ロジスティック回帰

Logistic Regression

Logistic RegressionSigmoid squashes logit z to P(y=1|x); decision boundary at p = 0.5 (z = 0)-6-4-20246Logit z (linear score w·x + b)0.000.250.500.751.00P(y=1 | x)Decision boundaryz = 0, p = 0.5Class 0 (negative)Class 1 (positive)p 1 (asymptote)p 0 (asymptote)Key MechanicsSigmoid functionσ(z) = 1 / (1 + e⁻ᶣ)Log-odds (logit)log[p/(1-p)] = w·x + bMLE objectivemax Σ y log p + (1-y) log(1-p)Binary cross-entropyLoss = -[y log p + (1-y) log(1-p)]RegularisationL2 (Ridge) shrinks weights, prevents overfitUnlike linear regression, LR is trained via gradient descent on log-loss, not OLS; outputs are calibrated probabilities, not raw scores

1次元の特徴量と確率の関係をシグモイド関数でフィッティングしたもの。決定境界は p = 0.5 の位置に対応し、対数オッズ(ロジット)= 0 の閾値と一致する。2次元版では特徴量空間における線形境界として表される。最尤推定(MLE)の目的関数と勾配も付記されている。

English version