Cost Function For Logistic Regression
Cost Function For Logistic Regression
x=1 → y=0
x =0 → y=-inf
In the above graph, we have to observe that
as we go towards x=0, y value increases
almost similar to an exponential curve.
This characteristic makes the log graph a
good candidate for using as a loss function
because it satisfies the first characteristic of
the loss function, i.e., heavily penalizing the
samples that are away from the desired
value.
As we always prefer positive values, we plot
the above function with a slight modification
(y = -log(x)) so that our concerned area in the
above graph is moved into quadrant I.
y = -log(x) graph
Axes in the above graph are interpreted as: