binary_cross_entropy: Estimates the inverse binary cross-entropy, i.e. 0 is the...

View source: R/utils.R

binary_cross_entropyR 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 (individuals) or geographic units (L2 units). Default is individuals.

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 survey and census at which outcomes should be aggregated.

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.


autoMrP documentation built on May 29, 2024, 6:40 a.m.