Prediction function not working on R

I create a random forest on my local desktop and save the model and upload it to the remote Linux machine. Below is the code snippet

iris.rf <- randomForest(species ~ ., data=iris, ntree=11)
save(iris.rf, file = "mymodel.rda")

      

On my 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 the next error

Error in UseMethod ("predict"): no applicable method for "predicting" applied to object of class "c" ("randomForest.formula", "randomForest") "

A random forest model is loaded into the environment, but for some reason the predict

model call does not work Any idea why this isn't working?

+3
linux r random-forest


source to share


No one has answered this question yet

Check out similar questions:

3
How can I reduce the size of the RandomForest model?
2
NAs in rasters and randomForest :: pred ()
1
Apply pred () between data.frames in two lists
1
R random forest conflicting predictions
1
What is the special operator "~" in R?
0
Improving the speed of predicting new data using a random forest model
0
Function Choice and Prediction Accuracy in Forest Regression in R
0
R Code: prediction function () Error in UseMethod method in loop
0
Error in R-Predict function when RDS file is passed as command line argument
0
R Random forest prediction does not work



All Articles
Loading...
X
Show
Funny
Dev
Pics