Learn R Programming

daltoolboxdp (version 1.2.737)

fs_fss: Forward Stepwise Selection

Description

Greedy feature selection that iteratively adds the feature which most improves the model according to an adjustment metric (e.g., adjusted R^2). Wraps leaps::regsubsets.

Usage

fs_fss(attribute)

Value

A fs_fss object.

Arguments

attribute

Character. Name of the target variable.

References

Hastie, T., Tibshirani, R., & Friedman, J. (2009). The Elements of Statistical Learning.

Examples

Run this code
if (FALSE) {
data(iris)

# 1) Forward stepwise for numeric response (adjusted R^2 criterion)
fs <- daltoolbox::fit(fs_fss("Sepal.Length"), iris)
fs$features

# 2) Subset to selected features + target
data_fss <- daltoolbox::transform(fs, iris)
head(data_fss)
}

Run the code above in your browser using DataLab