Skip to contents

Predicts from a fitted ci_forest() object and fits a greedy ci_tree() to the forest predictions. The result is the same kind of surrogate used internally by tune_ci_forest() to score forest tuning settings by concentration-index validation gain.

Usage

ci_forest_surrogate(
  forest_fit,
  data = NULL,
  formula = NULL,
  rank_name = NULL,
  weights = NULL,
  type = NULL,
  control = NULL,
  prediction_name = "forest_risk",
  na.action = stats::na.omit
)

Arguments

forest_fit

A fitted ci_forest object.

data

Optional data used to fit the surrogate. Defaults to the forest training data stored in forest_fit.

formula

Optional formula defining the surrogate predictors. Defaults to the formula stored in forest_fit, with the original outcome replaced by prediction_name.

rank_name

Optional rank column name. Defaults to forest_fit$rank_name.

weights

Optional non-negative case weights for data. Defaults to the forest training weights when data has the same number of rows as the original training data, otherwise equal weights.

type

Optional concentration-index type. Defaults to forest_fit$type.

control

Optional ci_tree_control() for the surrogate. Defaults to the forest controls with mtry = NULL.

prediction_name

Name of the prediction column added to the surrogate data.

na.action

A function for handling missing values in the surrogate tree fit.

Value

A list with fit, data, and prediction_name.