【发布时间】:2021-03-21 20:20:22
【问题描述】:
我正在尝试为每月时间序列数据训练回归随机森林模型。但是,当尝试运行以下代码时
# Training the model
model_rf <- train(diff_gasp ~ ., data = diff_gas, method = "cforest",
metric = "RMSE", trControl = ctrl, tuneGrid = grid_rf)
我得到错误:
1 package is needed for this model and is not installed. (party). Would you like to try to install it now?
1: yes
2: no
据推测,train() 位于已安装和导入的 caret 包中。这个错误不是交互式的......所以我不能点击或输入“是”,看看会发生什么。我尝试安装包“party”,但似乎没有加载。
我能做什么?
这是数据的链接源(非差异gas_data.csv和差异diff_gas.csv),其中最后一列(gas price) 是标签,其余列是特征:https://drive.google.com/drive/folders/1R5-vVkgQLEpVaQkqq7k96O4nF_LJ1aqA?usp=sharing
我想使用随机森林回归模型进行预测,并了解数据中最相关的特征来预测汽油价格。对于如何实现这一目标的帮助将不胜感激。
【问题讨论】:
-
你可以输入yes然后回车。或者,@Robert_Wilson 下面的建议是正确的。
标签: r time-series regression random-forest forecasting