Learn R Programming

LogicForest (version 2.1.3)

predict.logforest: Predict Outcomes Using a Logic Forest Model

Description

Computes predicted values for new observations or the out-of-bag (OOB) predictions for a logic forest model fitted using logforest.

Usage

# S3 method for logforest
predict(object, newdata, cutoff, ...)

Value

An object of class "LFprediction" containing:

  • LFprediction: numeric vector of predicted responses.

  • proportion_one: numeric vector of the proportion of trees predicting class 1 (classification only).

  • AllTrees: matrix or data frame with predicted values from each tree, the proportion of trees predicting 1, and the overall predicted class (classification), or predicted values for regression/time-to-event models.

Arguments

object

An object of class "logforest".

newdata

A matrix or data frame of new predictor values. If omitted, predictions are made for the original data used to fit the model (OOB predictions).

cutoff

A numeric value between 0 and 1 specifying the minimum proportion of trees that must predict a class of 1 for the overall prediction to be 1. Ignored for non-classification models.

...

Additional arguments (currently ignored).

Author

Bethany Wolf wolfb@musc.edu

Details

For classification models, predictions are determined based on the cutoff proportion. For regression or time-to-event models, the function returns predicted values and OOB statistics if newdata is not provided.

See Also

logforest