jackknife | R Documentation |
Create metrics for models with and without each variable.
jackknife(model, ...) ## S3 method for class 'train' jackknife( model, summaryFunction = NULL, errorFunction = ci_95, param_override_only = NULL, param_override_without = NULL, progress = FALSE, ... ) ## S3 method for class 'jackknife.train' plot(x, metric = NULL, plot_errorbar = TRUE, ...)
model |
A model returned by |
... |
ignored |
summaryFunction |
A Summary function (one of |
errorFunction |
A function used to calculate errors across resamples. Default is 95% confidence interval. |
param_override_only, param_override_without |
A list or data.frame with parameters to override the best tune before they are passed to "train" to create a model with only and without one variable. Useful for models where tuning parameters are dependent of the number of variables (like 'mtry' for randomForest). |
progress |
logical. Show progress bar? |
x |
An object from |
metric |
A character, indicating which metric to plot. If |
plot_errorbar |
logical. Should plot error bars? |
Multiple models are created using the same method and parameters of the model
.
Each variable is excluded in turn, and a model created with the remaining variables.
Then a model is created using each variable in isolation. Metrics (provided by summaryFunction
)
are calculated for each model.
A data.table that also inherts "jackknife.train" with metrics for each variable.
## Not run: jackknife.train(model) # using caret twoClassSummary and standard deviation as errors jackknife.train(model, summaryFunction = twoClassSummary, errorFunction = sd) # For models trained with 'rf', override 'mtry' as 1 when training with a single variable j <- jackknife.train(model, param_override_only = list(mtry=1)) plot(j) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.