mplot_full: MPLOTS Score Full Report Plots

Description Usage Arguments Value See Also Examples

View source: R/model_plots.R

Description

This function plots a whole dashboard with a model's results. It will automatically detect if it's a categorical or regression's model by checking how many different unique values the independent variable (tag) has.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mplot_full(
  tag,
  score,
  multis = NA,
  splits = 8,
  thresh = 6,
  subtitle = NA,
  model_name = NA,
  plot = TRUE,
  save = FALSE,
  subdir = NA,
  file_name = "viz_full.png"
)

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).

splits

Integer. Number of separations to plot

thresh

Integer. Threshold for selecting binary or regression models: this number is the threshold of unique values we should have in 'tag' (more than: regression; less than: classification)

subtitle

Character. Subtitle to show in plot

model_name

Character. Model's name

plot

Boolean. Plot results? If not, plot grid object returned

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

Value

Multiple plots gathered into one, showing tag vs score performance results.

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
Sys.unsetenv("LARES_FONT") # Temporal
data(dfr) # Results for AutoML Predictions
lapply(dfr, head)

# Dasboard for Binomial Model
mplot_full(dfr$class2$tag, dfr$class2$scores, 
          model_name = "Titanic Survived Model")

# Dasboard for Multi-Categorical Model
mplot_full(dfr$class3$tag, dfr$class3$score,
          multis = subset(dfr$class3, select = -c(tag, score)),
          model_name = "Titanic Class Model")
          
# Dasboard for Regression Model
mplot_full(dfr$regr$tag, dfr$regr$score, 
          model_name = "Titanic Fare Model")

lares documentation built on June 9, 2021, 9:06 a.m.