RedYellowGreen: RedYellowGreen

View source: R/RedYellowGreen.R

RedYellowGreenR Documentation

RedYellowGreen

Description

This function will find the optimial thresholds for applying the main label and for finding the optimial range for doing nothing when you can quantity the cost of doing nothing

Usage

RedYellowGreen(
  data,
  PredictColNumber = 2,
  ActualColNumber = 1,
  TruePositiveCost = 0,
  TrueNegativeCost = 0,
  FalsePositiveCost = -10,
  FalseNegativeCost = -50,
  MidTierCost = -2,
  Cores = 8,
  Precision = 0.01,
  Boundaries = c(0.05, 0.75)
)

Arguments

data

data is the data table with your predicted and actual values from a classification model

PredictColNumber

The column number where the prediction variable is located (in binary form)

ActualColNumber

The column number where the target variable is located

TruePositiveCost

This is the utility for generating a true positive prediction

TrueNegativeCost

This is the utility for generating a true negative prediction

FalsePositiveCost

This is the cost of generating a false positive prediction

FalseNegativeCost

This is the cost of generating a false negative prediction

MidTierCost

This is the cost of doing nothing (or whatever it means to not classify in your case)

Cores

Number of cores on your machine

Precision

Set the decimal number to increment by between 0 and 1

Boundaries

Supply a vector of two values c(lower bound, upper bound) where the first value is the smallest threshold you want to test and the second value is the largest value you want to test. Note, if your results are at the boundaries you supplied, you should extent the boundary that was reached until the values is within both revised boundaries.

Value

A data table with all evaluated strategies, parameters, and utilities, along with a 3d scatterplot of the results

Author(s)

Adrian Antico

See Also

Other Model Evaluation and Interpretation: AutoShapeShap(), CumGainsChart(), EvalPlot(), ParDepCalPlots(), ROCPlot(), ResidualPlots(), SingleRowShapeShap(), threshOptim()

Examples

## Not run: 
data <- data.table::data.table(Target = runif(10))
data[, x1 := qnorm(Target)]
data[, x2 := runif(10)]
data[, Predict := log(pnorm(0.85 * x1 +
  sqrt(1-0.85^2) * qnorm(x2)))]
data[, ':=' (x1 = NULL, x2 = NULL)]
data <- RedYellowGreen(
  data,
  PredictColNumber  = 2,
  ActualColNumber   = 1,
  TruePositiveCost  = 0,
  TrueNegativeCost  = 0,
  FalsePositiveCost = -1,
  FalseNegativeCost = -2,
  MidTierCost = -0.5,
  Precision = 0.01,
  Cores = 1,
  Boundaries = c(0.05,0.75))

## End(Not run)

AdrianAntico/RemixAutoML documentation built on Feb. 3, 2024, 3:32 a.m.