metric_error_checking_family: metric_error_checking_family

Description Usage Arguments

View source: R/metric_error_checking.R

Description

function containing all of the error catching for calculating model metrics This includes vectors being of the correct length and type, actuals and predictions agreeing with the distribution family and the distribution family being allowed

Usage

1
2
3
4
5
6
7
8
9
metric_error_checking_family(
  actual,
  predicted,
  weight = NULL,
  family = "gaussian",
  na.rm = FALSE,
  rebase = FALSE,
  tweedie_power = NULL
)

Arguments

actual

Array[Numeric] - Values we are aiming to predict.

predicted

Array[Numeric] - Values that we have predicted.

weight

Optional: Array[Numeric] - Weighting of predictions. If NULL even weighting is used

family

String - family of distribution. Must be in c("gaussian", "poisson", "gamma", "tweedie", "binomial")

na.rm

Optional: boolean - If FALSE function will return NA is any value in NA

rebase

Optional: boolean - If TRUE predictions weighted mean will be rebased to match actual mean

tweedie_power

Numeric - power of tweedie distribution if chosen in family


gloverd2/admr documentation built on Dec. 2, 2020, 11:16 p.m.