Description Usage Arguments Value Examples
eztune_cv
returns the cross-validated
loss measures for a model returned by eztune
.
The function eztune
can tune a model using validation data,
cross validation, data splitting, or resubstitution. If resubstitution
or a data splitting method (via the fast
option) is used to
tune the model, the accuracy obtained from the function
may not be accurate. The function eztune_cv
will return
cross-validated accuracy measures for any model returned by eztune
.
1 | eztune_cv(x, y, model, cross = 10)
|
x |
Matrix or data frame containing the dependent variables used to create the model. |
y |
Vector of the response used to create the model. Can be either numeric or a factor. |
model |
An Object of class |
cross |
Number of folds to use for n-fold cross-validation. |
Function returns a numeric value that represents the cross-validated accuracy of the model. Both classification accuracy and the AUC are returned for models with a binary response. MSE and mean absolute error (MAE) are returned for models with a continuous response.
accuracy |
Cross-validated classification accuracy. |
auc |
Cross-validated AUC. |
mse |
Cross-validated MSE. |
mae |
Cross-validated MAE. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(mlbench)
data(Sonar)
sonar <- Sonar[sample(1:nrow(Sonar), 100), ]
y <- sonar[, 61]
x <- sonar[, 1:10]
sonar_default <- eztune(x, y)
eztune_cv(x, y, sonar_default)
sonar_svm <- eztune(x, y, fast = FALSE, cross = 3)
eztune_cv(x, y, sonar_svm)
sonar_gbm <- eztune(x, y, method = "gbm", fast = 50)
eztune_cv(x, y, sonar_gbm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.