resamples

0th

Percentile

Collation and Visualization of Resampling Results

These functions provide methods for collection, analyzing and visualizing a set of resampling results from a common data set.

Keywords
models
Usage
resamples(x, ...)

## S3 method for class 'default': resamples(x, modelNames = names(x), ...)

## S3 method for class 'resamples': summary(object, ...)

Arguments
x
a list of two or more train objects with a common set of resampling indices in the control object.
modelNames
an optional set of names to give to the resampling results
object
an object generated by resamples
...
not currently used
Details

The results from train can have more than one performance metric per resample. Each metric in the input object is saved.

resamples checks that the resampling results match; that is, the indices in the object trainObject$control$index are the same. Also, the argument trainControl returnResamp should have a value of "final" for each model.

The summary function computes summary statistics across each model/metric combination.

Value

  • An object with class "resamples" with elements
  • callthe call
  • valuesa data frame of results where rows correspond to resampled data sets and columns indicate the model and metric
  • modelsa character string of model labels
  • metricsa character string of performance metrics
  • methodsa character string of the train method argument values for each model

See Also

train, trainControl

Aliases
  • resamples.default
  • resamples
  • summary.resamples
Examples
data(BloodBrain)
set.seed(1)
tmp <- createDataPartition(logBBB,
                           p = .8,
                           times = 100)

rpartFit <- train(bbbDescr, logBBB,
                  "rpart", 
                  tuneLength = 16,
                  trControl = trainControl(
                    method = "LGOCV", index = tmp))


ctreeFit <- train(bbbDescr, logBBB,
                  "ctree", 
                  trControl = trainControl(
                    method = "LGOCV", index = tmp))


earthFit <- train(bbbDescr, logBBB,
                  "earth",
                  tuneLength = 20,
                  trControl = trainControl(
                    method = "LGOCV", index = tmp))

resamps <- resamples(list(CART = rpartFit,
                          CondInfTree = ctreeFit,
                          MARS = earthFit))

## or load pre-calculated results using:
## load(url("http://caret.r-forge.r-project.org/Classification_and_Regression_Training_files/exampleModels.RData"))

resamps
summary(resamps)
Documentation reproduced from package caret, version 4.41, License: GPL-2

Community examples

Looks like there are no examples yet.