Learn R Programming

daltoolbox (version 1.3.767)

feature_selection_stepwise: 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
)

Value

returns an object of class feature_selection_stepwise

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.

Examples

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

Run the code above in your browser using DataLab