binary_cross_entropy {autoMrP} | R Documentation |
Estimates the inverse binary cross-entropy, i.e. 0 is the best score and 1 the worst.
Description
binary_cross_entropy()
estimates the inverse binary cross-entropy on
the individual and state-level.
Usage
binary_cross_entropy(
pred,
data.valid,
loss.unit = c("individuals", "L2 units"),
y,
L2.unit
)
Arguments
pred |
Predictions of outcome. A numeric vector of outcome predictions. |
data.valid |
Test data set. A tibble of data that was not used for prediction. |
loss.unit |
Loss function unit. A character-valued scalar indicating
whether performance loss should be evaluated at the level of individual
respondents ( |
y |
Outcome variable. A character vector containing the column names of the outcome variable. |
L2.unit |
Geographic unit. A character scalar containing the column name
of the geographic unit in |
Value
Returns a tibble containing two binary cross-entropy prediction errors. The first is measured at the level of individuals and the second is measured at the context level. The tibble dimensions are 2x3 with variables: measure, value and level.