Concept
In binary classification, where
This math takes the form of,
For
is a cost function when . When (not just 0), cost is 0. When , cost linearly increases as gets smaller. is a cost function when . When (not just 0), cost is 0. When , cost linearly increases as gets larger.
By
In An Introduction to Statistical Learning (ISL), where
This math takes the form of,
- When
, produces 0 if . Loss is when and increase as gets smaller. - When
, produces 0 if . Loss is when and increase as gets larger.
This loss functions is known as hinge loss.
By
To see the relationship with logistic regression, the optimization objective of logistic regression that we wanna minimize is the followin.
- When
, we want ( to be close to ), we want small, we want ( is much larger than 0). - When
, we want ( to be close to ), we want large, we want ( is much smaller than 0).
In below sigmoid function visualization,