Comparison

Logistic regression loss function vs. cost function

For logistic regression, the loss function L(y^(i),y(i))L(\hat{y}^{(i)},y^{(i)}) measures the error for one training example. The cost function aggregates these losses across all mm training examples, typically by taking their average: J(w,b)=1mi=1mL(y^(i),y(i))J(w,b)=\frac{1}{m}\sum_{i=1}^{m}L(\hat{y}^{(i)},y^{(i)}).

0

2

Updated 2026-08-29

Tags

Data Science