predict.logforest: Prediction of Response Using Logic Forest

Description Usage Arguments Value Author(s) See Also Examples

View source: R/predict.logforest.R

Description

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

Usage

1
2
## S3 method for class 'logforest'
predict(object, newdata, cutoff, ...)

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

LFprediction

a numeric vector of predicted responses.

proportion_one

a numeric vector of the proportion of trees in the forest that predict a class value of one.

AllTrees

a 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.

If no new data are given, the function returns the out-of-bag prediction for the original data. The function returns a matrix. The first column is the out-of-bag prediction for all observations from the original data and the second column is the proportion of out-of-bag trees the predict a one.

Author(s)

Bethany Wolf wolfb@musc.edu

See Also

logforest

Examples

1
2
3
4
5
6
7
8
9
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])

LogicForest documentation built on May 30, 2017, 3:07 a.m.