Extract the most "important" predictors for regression and classification models.
topPredictors(object, n = 1L, ...) # S3 method for default topPredictors(object, n = 1L, ...) # S3 method for train topPredictors(object, n = 1L, ...)
| object | A fitted model object of appropriate class (e.g., |
|---|---|
| n | Integer specifying the number of predictors to return. Default is
|
| ... | Additional optional arguments to be passed onto
|
This function uses the generic function varImp to
calculate variable importance scores for each predictor. After that, they are
sorted at the names of the n highest scoring predictors are returned.