gain_lift: Cumulative Gain, Lift and Response

View source: R/model_metrics.R

gain_liftR Documentation

Cumulative Gain, Lift and Response

Description

This function calculates cumulative gain, lift, and response values for a predictive score of a specific target. You can use the mplot_gain() function to create a plot.

Usage

gain_lift(
  tag,
  score,
  target = "auto",
  splits = 10,
  plot = FALSE,
  quiet = FALSE
)

Arguments

tag

Vector. Real known label

score

Vector. Predicted value or model's result

target

Value. Which is your target positive value? If set to 'auto', the target with largest mean(score) will be selected. Change the value to overwrite. Only used when binary categorical model.

splits

Integer. Number of percentiles to split the data

plot

Boolean. Plot results? Uses mplot_gain()

quiet

Boolean. Quiet all messages, warnings, recommendations?

Value

data.frame when plot=FALSE or plot when plot=TRUE.

See Also

Other Machine Learning: ROC(), conf_mat(), export_results(), h2o_automl(), h2o_predict_API(), h2o_predict_MOJO(), h2o_predict_binary(), h2o_predict_model(), h2o_selectmodel(), impute(), iter_seeds(), lasso_vars(), model_metrics(), model_preprocess(), msplit()

Other Model metrics: ROC(), conf_mat(), errors(), loglossBinary(), model_metrics()

Examples

data(dfr) # Results for AutoML Predictions
head(dfr$class2)

# Results for Binomial Model
gain_lift(dfr$class2$tag, dfr$class2$scores, target = "FALSE")
gain_lift(dfr$class2$tag, dfr$class2$scores, target = "TRUE", splits = 5)

lares documentation built on Nov. 5, 2023, 1:09 a.m.