Description Usage Arguments Value Examples
View source: R/model_comparison_table.R
model_comparison_table Takes in training data, testing data, with the target as the last column and fitted models with meaningful names, then generates a model comparison table.
1 | model_comparison_table(train_data, test_data, ...)
|
train_data |
tibble of training data with target as last column |
test_data |
tibble of testing data with target as last column |
... |
fitted models assigned to meaningful model names |
tibble of results, allowing you to compare models
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
library(RMLViz)
library(mlbench)
data(Sonar)
toy_classification_data <- dplyr::select(dplyr::as_tibble(Sonar), V1, V2, V3, V4, V5, Class)
train_ind <- caret::createDataPartition(toy_classification_data$Class, p=0.9, list=F)
train_set_cf <- toy_classification_data[train_ind, ]
test_set_cf <- toy_classification_data[-train_ind, ]
gbm <- caret::train(Class~., train_set_cf, method="gbm", verbose=F)
lm_cf <- caret::train(Class~., train_set_cf, method="LogitBoost", verbose=F)
model_comparison_table(train_set_cf, test_set_cf,
gbm_mod=gbm, log_mod = lm_cf)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.