【问题标题】:R: Error training data in random forest regression modelR:随机森林回归模型中的错误训练数据
【发布时间】: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


【解决方案1】:

安装插入符号不会安装它可以使用的建模包,以避免不使用的包填满您的硬盘驱动器。您需要单独安装它们。在这种情况下,您需要运行:

install.packages("party")

【讨论】:

    猜你喜欢
    • 2018-12-06
    • 2022-11-11
    • 1970-01-01
    • 2019-07-20
    • 2018-12-21
    • 2013-07-23
    • 2021-12-29
    • 2021-09-29
    • 2019-04-24
    相关资源
    最近更新 更多