Learn R Programming

daltoolbox (version 1.3.727)

feature_selection_fss: Feature selection by forward stepwise search

Description

Selects numeric predictors using forward stepwise subset search.

Usage

feature_selection_fss(attribute, features = NULL)

Value

returns an object of class feature_selection_fss

Arguments

attribute

target attribute name

features

optional vector of feature names (default: all columns except attribute)

Details

Uses leaps::regsubsets and keeps the subset with the highest adjusted R-squared.

Examples

Run this code
if (requireNamespace("leaps", quietly = TRUE)) {
 data(iris)
 fs <- feature_selection_fss("Sepal.Length")
 fs <- fit(fs, iris)
 fs$selected
 iris_fs <- transform(fs, iris)
 names(iris_fs)
}

Run the code above in your browser using DataLab