Description Usage Arguments Value Examples
cross.val Runs k-fold cross validation via rolling window. Any required libraries to run the classification algorithm should already be loaded.
1 |
model.function |
function name of the classification algorithm call |
model.args |
arguments to pass to the function call |
data.train |
data frame or matrix of training data, depending on what the algorithm requires |
no.subsets |
number of folds to run cross-validation on. Defaults to 5. |
list(rates, mean.rates) - percentage successful predictions and mean success rate of training and testing no.subsets
1 2 3 4 5 6 | # Example with multinom
# cross.val(model.function = multinom, model.args = list(formula = popularity ~ ., data = training), data = training)
# $rates
# [1] 0.4941667 0.4810417 0.4658333 0.4770833 0.4935417
# $mean.rate
# [1] 0.4823333
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.