Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 随机森林模型问题_R_Random Forest - Fatal编程技术网

R 随机森林模型问题

R 随机森林模型问题,r,random-forest,R,Random Forest,我在R中运行了随机森林模型,现在我调用它来预测我的数据集 predict.rf<-predict(layers.stack,random.forest, na.rm=T, type='response') predict.rf您似乎使用了两种不同的R脚本—一种用于培训,另一种用于预测。此错误意味着您的prediction R脚本不知道randomForest(.formula)类 您只需将“randomForest”库导入到prediction R脚本中即可修复此问题: library(

我在R中运行了随机森林模型,现在我调用它来预测我的数据集

predict.rf<-predict(layers.stack,random.forest, na.rm=T, type='response')

predict.rf您似乎使用了两种不同的R脚本—一种用于培训,另一种用于预测。此错误意味着您的prediction R脚本不知道
randomForest(.formula)

您只需将“randomForest”库导入到prediction R脚本中即可修复此问题:

library("randomForest")

这个问题只能通过访问您的数据样本来解决。亲爱的NelsonGon,非常感谢您的评论,我知道如果没有数据集,您很难解决问题,但是数据集包含88个超过200 GB的卫星图像,因此我无法在此上传,非常抱歉,非常感谢您的评论,是的,我确实在单独的文件中编写了随机森林模型,然后调用它在另一个文件中运行,我将按照您刚才的建议添加库(“随机森林”),干杯