Learn R Programming

LogicForest (version 2.0.0)

predict.logforest: Prediction of Response Using Logic Forest

Description

Computes predicted values for newdata or the out-of-bag prediction for a logic forest model fitted using logforest.

Usage

## S3 method for class 'logforest':
predict(object, newdata, cutoff, \ldots)

Arguments

object
an object of class logforest.
newdata
a matrix or data frame containing new predictor values. If not given, predictions will be made for the original data used to construct the model.
cutoff
a number between 0 and 1 for the minimum proportion of trees in the logic forest that must predict a 1 for the prediction to be one.
...
not currently used.

Value

  • If new data are given, predict returns an object of class "LFprediction", that includes a list of elements
  • LFpredictiona numeric vector of predicted responses.
  • proportion_onea numeric vector of the proportion of trees in the forest that predict a class value of one.
  • AllTreesa matrix/vector containing the predicted values of each tree in a logic forest for each response, the proportion of trees that predict a one, and the predicted class for each observations.

See Also

logforest

Examples

Run this code
data(LF.data, LF.testdata, logforest.fit)


#predicting classes for the original data
#NOTE- this is the out-of-bag prediction
predict(object=logforest.fit)

#predicting classes for new test data
predict(object=logforest.fit, newdata=LF.testdata[,1:50])

Run the code above in your browser using DataLab