k_fold_cross | R Documentation |
k_fold_cross splits the dataset into k parts, and uses k-1 parts to train the model and the remaining part to test the model.
k_fold_cross(data,k)
data |
dataset which will be used for K-Fols Cross Validation |
k |
integer |
a list with two sublists: training set and test set
df = data.frame("hours"=c(1, 2, 4, 5, 5, 6, 6, 7, 8, 10, 11, 11, 12, 12, 14),
"score"=c(64, 66, 76, 73, 74, 81, 83, 82, 80, 88, 84, 82, 91, 93, 89))
k_fold_cross(df,k=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.