models | R Documentation |
Models are created with 10-fold CV 3 x repeated in caret (see also the source section of this documentation). The output is saved as .rda file. This is to prevent the necessity of including the caret package as an additional dependency to the datscience package
data(models)
An object of class "list"
;
# Create Example Classifiers in the Iris Dataset
set.seed(7)
data(iris)
# Settings for the Cross-Validation
control <- caret::trainControl(method="repeatedcv", number=10, repeats=3,
summaryFunction = caret::multiClassSummary)
# Train Decision Tree
decision_tree <- caret::train(Species~., data=iris, method="rpart",
trControl=control, tuneLength=5)
# Train k-Nearest Neighbors
knn <- caret::train(Species~., data=iris, method="knn",
trControl=control, tuneLength=5)
# Create a list of objects
models <- list("Decision Tree" = decision_tree$resample,
"KNN" = knn$resample)
data(models) flex_resample_metrics(models, table_caption = NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.