f_logit_cost: Logistic Cost

Description Usage Arguments Details Value See Also Examples

Description

Calculate the logistic cost of probability predictions of a dichotomous outcome.

Usage

1
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”.

Details

This function is included in this library as a convenience.

Value

A numeric vector of length equal to y and yhat. The logistic cost associated with each corresponding prediction.

See Also

f_fit_gradient_logistic_01, predict.mactivate_fit_gradient_logistic_01.

Examples

1
2
3
4
y <- c(0, 0, 1, 1)
yhat <- rep(1/2, length(y))

mean( f_logit_cost(y=y, yhat=yhat) )

mactivate documentation built on Aug. 2, 2021, 5:07 p.m.