Description Usage Arguments Value Author(s) See Also Examples
View source: R/predict.logforest.R
Computes predicted values for newdata or the out-of-bag prediction for a logic forest model fitted using logforest
.
1 2 |
object |
an object of class |
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. |
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.
Bethany Wolf wolfb@musc.edu
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])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.