STUMP: Classification using one-level decision tree

STUMPR Documentation

Classification using one-level decision tree

Description

This function builds a classification model using CART with maxdepth = 1.

Usage

STUMP(
  train,
  labels,
  randomvar = FALSE,
  tune = FALSE,
  methodparameters = NULL,
  graph = FALSE,
  seed = NULL,
  ...
)

Arguments

train

The training set (description), as a data.frame.

labels

Class labels of the training set (vector or factor).

randomvar

If TRUE, the stump is built on a single variable drawn at random instead of the best one (useful to build weak learners for an ensemble method). Note that the model then differs from one call to the next unless seed is set. Defaults to FALSE, i.e. the usual decision stump, split on the variable selected by CART.

tune

If true, the function returns parameters instead of a classification model.

methodparameters

Present for interface consistency with performance (which always passes it when fitting a model). Currently unused: STUMP does not support reusing pre-tuned parameters.

graph

Present for interface consistency with performance (which always passes it when fitting a model). Currently unused: STUMP does not produce a plot.

seed

A specified seed for random number generation (used only if randomvar is TRUE).

...

Other parameters.

Value

The classification model.

See Also

CART

Examples

require (datasets)
data (iris)
STUMP (iris [, -5], iris [, 5])
STUMP (iris [, -5], iris [, 5], randomvar = TRUE, seed = 0)

fdm2id documentation built on Aug. 28, 2026, 9:07 a.m.