Key Takeaways
Logistic Regression: Models binary classification probabilities using sigmoid function
Cross-Entropy Loss: Natural loss for probability models, derived from MLE
Gradient: For logistic regression, ∇J(w)=m1∑(fw(xi)−yi)xi
Regularization: L2 corresponds to Gaussian prior; prevents overfitting
Softmax: Generalization of logistic regression to C>2 classes
Convexity: Both logistic and softmax regression have convex objectives → gradient descent finds global optimum
Connection: All these models are part of the Generalized Linear Model family
Mathematical Proofs Summary¶
Proof 1: Sigmoid Derivative¶
σ(z)=1+e−z1 σ′(z)=σ(z)(1−σ(z)) Proof:
σ′(z)=∂z∂(1+e−z)−1=−1⋅(1+e−z)−2⋅(−e−z)=(1+e−z)2e−z=1+e−z1⋅1+e−ze−z=σ(z)⋅[1+e−z1+e−z−1]=σ(z)⋅[1−1+e−z1]=σ(z)⋅(1−σ(z)) Proof 2: Logistic Loss Gradient¶
As shown in Section 6.7, the gradient is:
∇J(w)=m1i=1∑m(fw(xi)−yi)xi Proof 3: Softmax Convexity¶
The softmax objective is convex because:
log-sum-exp is convex (can be shown via Hessian positivity)
Affine composition preserves convexity
Sum of convex functions is convex
Proof 4: Softmax Gradient¶
As shown in Section 7.6:
∂wj∂J(W)=m1i=1∑m[fW(j)(xi)−I(yi=j)]xi