1 #ifndef STAN__MATH__FUNCTIONS__BINARY_LOG_LOSS_HPP
2 #define STAN__MATH__FUNCTIONS__BINARY_LOG_LOSS_HPP
4 #include <boost/math/tools/promotion.hpp>
25 inline typename boost::math::tools::promote_args<T>::type
28 return -
log(y ? y_hat : (1.0 - y_hat));
boost::math::tools::promote_args< T >::type binary_log_loss(const int y, const T y_hat)
Returns the log loss function for binary classification with specified reference and response values...
Eigen::Matrix< T, Rows, Cols > log(const Eigen::Matrix< T, Rows, Cols > &m)
Return the element-wise logarithm of the matrix or vector.
fvar< T > log(const fvar< T > &x)