Description Usage Arguments Details Value See Also Examples
Calculate the logistic cost of probability predictions of a dichotomous outcome.
1 | f_logit_cost(y, yhat)
|
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”. |
This function is included in this library as a convenience.
A numeric vector of length equal to y
and yhat
. The logistic cost associated with each corresponding prediction.
f_fit_gradient_logistic_01
, predict.mactivate_fit_gradient_logistic_01
.
1 2 3 4 | y <- c(0, 0, 1, 1)
yhat <- rep(1/2, length(y))
mean( f_logit_cost(y=y, yhat=yhat) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.