Skip to contents

Predict from a greedy concentration-index forest

Usage

# S3 method for class 'ci_forest'
predict(
  object,
  newdata = NULL,
  type = c("response", "node"),
  OOB = FALSE,
  FUN = NULL,
  ...
)

Arguments

object

A fitted ci_forest object from ci_forest().

newdata

Optional data for prediction. If omitted, the training data stored in object are used.

type

Prediction type. "response" returns averaged terminal-node summaries. "node" returns terminal node ids for each tree.

OOB

Should predictions for training rows use only trees where the row was out-of-bag? Rows without any out-of-bag tree return NA; they are never filled with in-sample tree averages. With OOB = TRUE, newdata must be omitted or must be the identical training data frame so that the in-bag mask can be applied to matching rows.

FUN

Optional function with signature function(y, w) used to summarize terminal nodes. By default, the weighted mean of outcome_name is used.

...

Currently ignored.

Value

A numeric vector for type = "response" or an integer matrix for type = "node". Out-of-bag predictions are returned for type = "response" only; type = "node" returns terminal node ids for every tree and ignores OOB.