mplot_density: Density plot for discrete and continuous values

View source: R/model_plots.R

mplot_densityR Documentation

Density plot for discrete and continuous values

Description

This function plots discrete and continuous values results

Usage

mplot_density(
  tag,
  score,
  thresh = 6,
  model_name = NA,
  subtitle = NA,
  save = FALSE,
  subdir = NA,
  file_name = "viz_distribution.png"
)

Arguments

tag

Vector. Real known label

score

Vector. Predicted value or model's result

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)

model_name

Character. Model's name

subtitle

Character. Subtitle 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

Value

Plot with distribution and performance results.

See Also

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

Examples

Sys.unsetenv("LARES_FONT") # Temporal
data(dfr) # Results for AutoML Predictions
lapply(dfr[c(1, 3)], head)

# Plot for binomial results
mplot_density(dfr$class2$tag, dfr$class2$scores, subtitle = "Titanic Survived Model")

# Plot for regression results
mplot_density(dfr$regr$tag, dfr$regr$score, model_name = "Titanic Fare Model")

laresbernardo/lares documentation built on Oct. 23, 2024, 12:05 p.m.