Home » Php » R scriptr Random Forest thought PHP

R scriptr Random Forest thought PHP

Posted by: admin February 25, 2020 Leave a comment

Questions:

I am calling R script (RandomForest) throught PHP, I copied model.rds and R script into web apps folder. Everything goes well but as soon as it reaches the line:

predicted=predict(super_model,newdata=PredictionTemp)

it stops with this error in my php page:

Error in UseMethod("predict") : 
  no applicable method for 'predict' applied to an object of class "c('randomForest.formula', 'randomForest')"
Calls: predict
Execution halted

In my RStudio, the R script performed with no errors. Do you have an idea if it comes from apache server or rights on files which can create this error?

How to&Answers: