Stan Math Library
5.0.0
Automatic Differentiation
|
|
inline |
Returns the log loss function for binary classification with specified reference and response values.
The log loss function for prediction \(\hat{y} \in [0, 1]\) given outcome \(y \in \{ 0, 1 \}\) is
\(\mbox{logloss}(1, \hat{y}) = -\log \hat{y} \), and
\(\mbox{logloss}(0, \hat{y}) = -\log (1 - \hat{y}) \).
T | value type |
[in] | y | reference value, either 0 or 1 |
[in] | y_hat | response value in [0, 1] |
Definition at line 30 of file binary_log_loss.hpp.