Calculate the logistic cost of probability predictions of a dichotomous outcome.
Usage
f_logit_cost(y, yhat)
Arguments
y
Numeric vector. The outcome vector. Must be in {0, 1}.
yhat
Numeric vector. Prediction vector. Should be in (0, 1) -- the open unit interval. In an inferential setting, one should probably never make a prediction of zero or one; however, values of zero or one are allowed, provided they are ``correct''.
Value
A numeric vector of length equal to y and yhat. The logistic cost associated with each corresponding prediction.
Details
This function is included in this library as a convenience.