Learn R Programming

ExhaustiveSearch (version 1.0.2)

getFeatures: Extract the feature sets from an ExhaustiveSearch object

Description

A simple function to get a vector of feature names for one or more elements of an ExhaustiveSearch object.

Usage

getFeatures(ESResult, ranks)

Value

If ranks is a single value, a vector of feature names is returned. If an intercept is included, the first element of this vector is "1". If ranks includes multiple values, a list of such vectors is returned.

Arguments

ESResult

a result object from an exhaustive search.

ranks

a numeric value or vector defining which elements should be returned.

Author

Rudolf Jagdhuber

See Also

ExhaustiveSearch()

Examples

Run this code
## Exhaustive search on the mtcars data
data(mtcars)
ES <- ExhaustiveSearch(mpg ~ ., data = mtcars, family = "gaussian")

## Get the feature combinations of the top 3 models
getFeatures(ES, 1:3)

## Get the feature combination of the 531th best model
getFeatures(ES, 531)

Run the code above in your browser using DataLab