Create visualizations to compare the performance of two models based on their performance metrics.
Usage
mrPerformancePlot(
ModelPerf1 = NULL,
ModelPerf2 = NULL,
mod_names = c("combined", "Xonly_model"),
mode = "classification"
)
Arguments
- ModelPerf1
Dataframe of model performance metrics for the first model to compare.
- ModelPerf2
Dataframe of model performance metrics for the second model to compare.
- mod_names
Character vector of model names. Default is
c('combined', 'Xonly_model')
.- mode
Character string indicating whether the mode is 'classification' or 'regression'. Default is 'classification'.
Value
A list containing:
- p1
A ggplot object for the boxplot of model performance metrics.
- p2
A ggplot object for the barplot of differences in performance metrics.
- wide_df
A dataframe with the wide format of model performance metrics and their differences.
Examples
plots <- mrPerformancePlot(ModelPerf1 =ModelPerf_lm, ModelPerf2 = ModelPerf_rf, mod_names=c('linear_reg','rand_forest'), mode='regression' )
#> Error in eval(expr, envir, enclos): object 'ModelPerf_lm' not found