| addXlevels {yaImpute} | R Documentation |
This function adds xlevels (see lm) to
randomForest objects. Function
AsciiGridImpute will check the levels on the input
maps to insure that only those used in the fitting are used in the predictions.
addXlevels(object,origDataFrame)
object |
an object built by randomForest |
origDataFrame |
the data frame used in the randomForest fit. |
An object of class randomForest with xlevels appended.
Nicholas L. Crookston ncrookston@fs.fed.us
Andrew O. Finley afinley@stat.umn.edu
yai and AsciiGridPredict
if (require(randomForest))
{
data(iris)
rf = randomForest(x=iris[,2:5],y=iris[,1])
new = addXlevels(rf,iris)
print(new$xlevels)
predict(new)
}