Description Usage Arguments Examples
returns a list containing a data frame of accuracy values and other cross-validation statistics. In the data frame, accuracy_subset contains accuracy of cross-validation on user-specified features, while accuracy_all contains accuracy of cross-validation on all the available features from in the data frame df. average_accuracy_subset is the average accuracy of n_iter iterations of cross-validation with user-specified features. average_acuracy_all is the average accuracy of n_iter iterations of cross-validation with all the available features. variance_accuracy_subset is the variance of accuracy of n_iter iterations of cross-validation with user-specified features. variance_accuracy_all is the variance of accuracy of n_iter iterations of cross-validation with all the available features.
1 | cross_validate(df, tree, n_iter, split_ratio, method)
|
df |
data frame on which cross-validation is being performed. |
tree |
tree object generated from rpart on df |
n_iter |
number of iterations for cross-validation |
split_ratio |
train/test split ratio for cross-validation. split_ratio is supposed to be between 0 to 1. |
method |
method for decision tree. The default value is 'class' for classification. Set method = 'anova' for regression. |
1 | cross_validate(df, tree, n_iter = 10, split_ratio = 0.8, method = 'class')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.