linux - predict function not working on R -
i creating random forest in local desktop , saving model , loading in remote linux machine. following code chunk
iris.rf <- randomforest(species ~ ., data=iris, ntree=11) save(iris.rf, file = "mymodel.rda")
on linux machine:
load(file="mymodel.rda") out <- predict(iris.rf,data.frame(sepal_length=1,sepal_width=2,petal_length=3,petal_width=4))
when predicting getting following error
error in usemethod("predict") : no applicable method 'predict' applied object of class "c('randomforest.formula', 'randomforest')"
the random forest model has been loaded in environment reason predict
call on model not working. idea why not working?
Comments
Post a Comment