Learn R Programming

caret (version 3.45)

predictors: List predictors used in the model

Description

This class uses a model fit to determine which predictors were used in the final model.

Usage

predictors(x, ...)

## S3 method for class 'train': predictors(x, ...)

## S3 method for class 'terms': predictors(x, ...)

## S3 method for class 'formula': predictors(x, ...)

## S3 method for class 'list': predictors(x, ...)

## S3 method for class 'mvr': predictors(x, ...)

## S3 method for class 'gbm': predictors(x, ...)

## S3 method for class 'Weka_classifier': predictors(x, ...)

## S3 method for class 'fda': predictors(x, ...)

## S3 method for class 'earth': predictors(x, ...)

## S3 method for class 'gausspr': predictors(x, ...)

## S3 method for class 'ksvm': predictors(x, ...)

## S3 method for class 'lssvm': predictors(x, ...)

## S3 method for class 'rvm': predictors(x, ...)

## S3 method for class 'train': predictors(x, ...)

## S3 method for class 'gpls': predictors(x, ...)

## S3 method for class 'knn3': predictors(x, ...)

## S3 method for class 'LogitBoost': predictors(x, ...)

## S3 method for class 'lda': predictors(x, ...)

## S3 method for class 'rda': predictors(x, ...)

## S3 method for class 'multinom': predictors(x, ...)

## S3 method for class 'nnet': predictors(x, ...)

## S3 method for class 'pcaNNet': predictors(x, ...)

## S3 method for class 'NaiveBayes': predictors(x, ...)

## S3 method for class 'randomForest': predictors(x, ...)

## S3 method for class 'pamrtrained': predictors(x, newdata = NULL, threshold = NULL, ...)

## S3 method for class 'superpc': predictors(x, newdata = NULL, threshold = NULL, n.components = NULL, ...)

## S3 method for class 'slda': predictors(x, ...)

## S3 method for class 'rpart': predictors(x, surrogate = TRUE, ...)

## S3 method for class 'regbagg': predictors(x, surrogate = TRUE, ...)

## S3 method for class 'classbagg': predictors(x, surrogate = TRUE, ...)

## S3 method for class 'glmboost': predictors(x, ...)

## S3 method for class 'gamboost': predictors(x, ...)

## S3 method for class 'blackboost': predictors(x, ...)

## S3 method for class 'BinaryTree': predictors(x, surrogate = TRUE, ...)

## S3 method for class 'RandomForest': predictors(x, surrogate = TRUE, ...)

## S3 method for class 'bagEarth': predictors(x, ...)

## S3 method for class 'bagFDA': predictors(x, ...)

## S3 method for class 'ppr': predictors(x, ...)

Arguments

x
a model object, list or terms
newdata
for pamrtrained and superpc: the training data
threshold
for pamrtrained and superpc: the feature selection threshold
n.components
for superpc: the number of PCA components used
surrogate
a logical for rpart, ipredbagg, bagging, Binar
...
not currently used

Value

  • a character string of predictors or NA.

Details

For randomForest, RandomForest, BinaryTree, rpart, ipredbagg, bagging, earth, fda, pamrtrained, superpc, bagEarth and bagFDA, an attempt was made to report the predictors that were actually used in the final model.

In cases where the predictors cannot be determined, NA is returned. For example, nnet.default may retrun missing values form predictors.