ordinalForest_wrapper: Fit wrapper for 'ordinalForest'

View source: R/rand_forest-ordinalForest.R

ordinalForest_wrapperR Documentation

Fit wrapper for ordinalForest

Description

A wrapper is needed since they have a non-standard model interface that requires the data set and the column name (character string) for the outcome.

Usage

ordinalForest_wrapper(x, y, ...)

Arguments

x

The predictor data.

y

The outcome factor.

...

Additional arguments to pass.

Value

An object of S3 class ordfor as returned by ordinalForest::ordfor().

Examples


house_data <-
  MASS::housing[rep(seq(nrow(MASS::housing)), MASS::housing$Freq), -5]
# subsample to reduce runtime
house_data <- house_data[sample(nrow(house_data), nrow(house_data) / 10), ]
# fit wrapper
# (using inadvisedly few score sets and trees to reduce runtime)
( fit_orig <- ordinalForest::ordfor(
  depvar = "Sat",
  data = house_data,
  nsets = 25, ntreefinal = 100
) )
( fit_wrap <- ordinalForest_wrapper(
  x = subset(house_data, select = -Sat),
  y = house_data$Sat,
  nsets = 25, ntreefinal = 100
) )


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