Description Usage Arguments Details Value
eval_model
uses k-fold cross-validation to assess the performance of a type
of model on a dataset.
1 2 3 4 5 6 7 8 9 | eval_model(
df,
resp = NA,
method,
nfold = 10,
simplify = T,
ignore_col = NA,
...
)
|
df |
The data frame to train the model on |
resp |
The name of the column to be used as a response variable. |
method |
The method to be used in model-building. See the description for available methods. |
nfold |
The number of folds to use in k-fold cross-validation. The
default is |
simplify |
Whether to return the results from all folds or return a data
frame summarizing the results (only reporting the average and standard
deviation of all folds). The default is |
ignore_col |
Columns that will not be used in model-building, given as a
character vector. This may be an identifying column. The default is
|
... |
Additional arguments to pass to the model method |
Currently, the function can evaluate the following model types, passed
through the parameter method
:
"rf"
: Random Forest from the package randomForest
"svm_linear"
: SVM with linear kernel from the package e1071
"svm_polynomial"
: SVM with polynomial kernel
"svm_radial"
: SVM with radial basis function kernel
"svm_sigmoid"
: SVM with sigmoid kernel
"earth"
: MARS with package earth
A data frame of the results of k-fold cross-validation with the
specified model parameters. Can be unsimplified (simplify = F
), returning
the result on each fold, or simplified, returning the average and standard
deviation only. The function uses caret::defaultSummary
and provides the
summary statistics of R-squared, RMSE, and MAE.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.