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

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 May 14, 2026, 9:06 a.m.