View source: R/set_model_params.R
MakeModelDefaults | R Documentation |
Makes a list containing the default parameters for all
models implemented in ModelTrain
.
MakeModelDefaults(n, p, classify, nfolds)
n |
The number of observations in the data. |
p |
The number of descriptors in the data. |
classify |
A logical. Will classification models be used? (is the response binary?) If false, regression models will be assumed. |
nfolds |
The number of folds used for k-fold cross validation. |
Sensible default values are selected for each tunable model parameter, however users may set any parameter manually by generating a list with this function and assigning the parameters.
See https://pages.github.ncsu.edu/jrash/chemmodlab/ for more information about the models available (including model default parameters).
A list whose elements are dataframes containing the
default parameter values for models implemented in
ModelTrain
.
Jeremy Ash
ModelTrain
, chemmodlab
params <- MakeModelDefaults(n = nrow(USArrests),
p = ncol(USArrests[, -1]), classify = TRUE, nfolds = 10)
params$Forest$mtry <- ncol(USArrests[, -1])-1
params
cml <- ModelTrain(USArrests, models = "RF", nsplits = 3,
user.params = params)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.