mplot_response: Cumulative Response Plot

mplot_responseR Documentation

Cumulative Response Plot

Description

The response gains plot helps us answer the question: When we apply the model and select up until ntile X, what is the expected

Usage

mplot_response(
  tag,
  score,
  multis = NA,
  target = "auto",
  splits = 10,
  highlight = "auto",
  caption = NA,
  save = FALSE,
  subdir = NA,
  file_name = "viz_response.png",
  quiet = FALSE
)

Arguments

tag

Vector. Real known label.

score

Vector. Predicted value or model's result.

multis

Data.frame. Containing columns with each category probability or score (only used when more than 2 categories coexist).

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 works for binary classes

splits

Integer. Numer of quantiles to split the data

highlight

Character or Integer. Which split should be used for the automatic conclussion in the plot? Set to "auto" for best value, "none" to turn off or the number of split.

caption

Character. Caption to show in plot

save

Boolean. Save output plot into working directory

subdir

Character. Sub directory on which you wish to save the plot

file_name

Character. File name as you wish to save the plot

quiet

Boolean. Do not show message for auto target?

Value

Plot with cumulative response and performance results by cuts.

See Also

Other ML Visualization: mplot_conf(), mplot_cuts(), mplot_cuts_error(), mplot_density(), mplot_full(), mplot_gain(), mplot_importance(), mplot_lineal(), mplot_metrics(), mplot_roc(), mplot_splits(), mplot_topcats()

Examples

Sys.unsetenv("LARES_FONT") # Temporal
data(dfr) # Results for AutoML Predictions
lapply(dfr, head)

# Plot for Binomial Model
mplot_response(dfr$class2$tag, dfr$class2$scores,
  caption = "Titanic Survived Model",
  target = "TRUE"
)
mplot_response(dfr$class2$tag, dfr$class2$scores,
  caption = "Titanic Survived Model",
  target = "FALSE"
)

# Plot for Multi-Categorical Model
mplot_response(dfr$class3$tag, dfr$class3$score,
  multis = subset(dfr$class3, select = -c(tag, score)),
  caption = "Titanic Class Model"
)

lares documentation built on Sept. 13, 2024, 1:08 a.m.