feature_selection_stepwise: Feature selection by stepwise model selection

View source: R/trans_feature_selection_stepwise.R

feature_selection_stepwiseR Documentation

Feature selection by stepwise model selection

Description

Select features using stepwise search over generalized linear models.

Usage

feature_selection_stepwise(
  attribute,
  features = NULL,
  direction = "forward",
  family = stats::binomial,
  trace = 0
)

Arguments

attribute

target attribute name

features

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

direction

stepwise direction: "forward", "backward", or "both"

family

glm family passed to stats::glm (default: binomial)

trace

level of tracing from stats::step

Details

Supports forward, backward, and both directions via stats::step. With the default binomial family, the target should represent a binary outcome.

Value

returns an object of class feature_selection_stepwise

References

Akaike, H. (1974). A New Look at the Statistical Model Identification. IEEE Transactions on Automatic Control, 19(6):716-723. Hastie, T., Tibshirani, R. and Friedman, J. (2009). The Elements of Statistical Learning (2nd ed.). Springer.

Examples

data(Boston)
fs <- feature_selection_stepwise("medv", direction = "forward", family = stats::gaussian)
fs <- fit(fs, Boston)
fs$selected
transform(fs, Boston) |> names()

daltoolbox documentation built on Nov. 23, 2026, 9:08 a.m.