Description Usage Arguments Details Value Author(s) See Also Examples
update
allows a user to over-ride the tuning parameter selection process by specifying a set of tuning parameters or to update the model object to the latest version of this package.
1 2 |
object |
an object of class |
param |
a data frame or named list of all tuning parameters |
... |
not currently used |
If the model object was created with version 5.17-7 or earlier, the underlying package structure was different. To make old train
objects consistent with the new structure, use param = NULL
to get the same object back with updates.
To update the model parameters, the training data must be stored in the model object (see the option returnData
in trainControl
. Also, all tuning parameters must be specified in the param
slot. All other options are held constant, including the original pre-processing (if any), options passed in using code... and so on. When printing, the verbiage "The tuning parameter was set manually." is used to describe how the tuning parameters were created.
a new train
object
Max Kuhn
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Loading required package: lattice
Loading required package: ggplot2
Warning in pre_process_options(method, column_types) :
The following pre-processing methods were eliminated: 'ignore'
k-Nearest Neighbors
150 samples
4 predictor
3 classes: 'setosa', 'versicolor', 'virginica'
Pre-processing: centered (4), scaled (4)
Resampling: Cross-Validated (10 fold)
Summary of sample sizes: 135, 135, 135, 135, 135, 135, ...
Resampling results across tuning parameters:
k Accuracy Kappa
5 0.9333333 0.90
7 0.9533333 0.93
9 0.9533333 0.93
11 0.9533333 0.93
13 0.9600000 0.94
15 0.9600000 0.94
17 0.9600000 0.94
19 0.9466667 0.92
21 0.9466667 0.92
23 0.9466667 0.92
The tuning parameter was set manually.
The final value used for the model was k = 3.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.