View source: R/helper-functions.R
k_fold_cv | R Documentation |
Applies k-Fold cross validation to the given model on the given data
k_fold_cv( data = NULL, model = NULL, random_state = NULL, k = 5, y_index = ncol(data) )
data |
The dataset to be used |
model |
A classification or a regression model (from LESS package) |
random_state |
A seed number to get reproducable result |
k |
Number of splits on the training set (defaults to 5) |
y_index |
Column index of the response variable on the given data. Default is the last column. |
A vector consists of metric of the individual folds and the average metric over the folds
k_fold_cv(data = iris, model = KNeighborsClassifier$new(), k = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.