threshold_finder: Finds the threshold to cut continous predictions to maximize...

Description Usage Arguments Value Examples

Description

This function takes a given performance metric (precision, accuracy, or recall) that requires a threshold and returns the threshold value that maximizes the specified metric

Usage

1
threshold_finder(func, predictions, outcomes)

Arguments

func

function, takes in other functions as arguments such as precision, accuracy and recall

predictions

list of numerics, predicted values

outcomes

list of numerics, actual values/outcomes

Value

numeric, value from 0 to 1 that is the threshold that maximizes the metric func

Examples

1
2
3
4
5
6
threshold_finder(precision, predictions = FakePredictionResults$est.risk.score,
outcomes = FakePredictionResults$true.risk.bin)
threshold_finder(recall, predictions = FakePredictionResults$est.risk.score,
outcomes = FakePredictionResults$true.risk.bin)
threshold_finder(accuracy, predictions = FakePredictionResults$est.risk.score,
outcomes = FakePredictionResults$true.risk.bin)

ksboxer/CDIPATools documentation built on June 5, 2019, 8:29 a.m.