orf_wrapper: Fit wrapper for 'orf'

View source: R/rand_forest-orf.R

orf_wrapperR Documentation

Fit wrapper for orf

Description

The orf package uses a non-standard interface that requires the predictor matrix X and the outcome vector Y as separate arguments, with Y as a numeric vector. This wrapper converts the parsnip-standard data.frame (X) and factor (Y) to the required formats before calling orf::orf().

Usage

orf_wrapper(X, Y, ...)

Arguments

X

The predictor data (data.frame).

Y

The outcome factor.

...

Additional arguments to pass.

Value

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

Examples


house_data <-
  MASS::housing[rep(seq(nrow(MASS::housing)), MASS::housing$Freq), -5]
house_data <- house_data[sample(nrow(house_data), 50), ]
# encode factors as dummy variables before passing to wrapper
X_mat <- model.matrix(~ Infl + Type + Cont - 1, data = house_data)
# fit wrapper
( fit_wrap <- orf_wrapper(
  X = X_mat,
  Y = house_data$Sat,
  num.trees = 10
) )


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