【问题标题】:RRF model is giving NA for test setRRF 模型为测试集提供 NA
【发布时间】:2018-12-11 09:26:21
【问题描述】:

我正在研究回归问题。 我在 R 中使用 RRF 来解决问题。 我制作了两个不同的数据集,一个用于训练,另一个用于测试。

    library(RRF)
    train=read.csv('training_data.csv'.header=F)
    model <- RRF(as.numeric(V128) ~ .,data=train, flagReg = 1,importance=TRUE,ntree=1000, keep.forest=TRUE,type=regression,na.action=na.roughfix)
    print(model)
    Call:
    RRF(formula = as.numeric(V128) ~ ., data = train, flagReg = 1,         importance = TRUE, ntree = 1000, keep.forest = TRUE, type = regression,      na.action = na.roughfix) 
           Type of random forest: regression
                 Number of trees: 1000
    No. of variables tried at each split: 2656

    Mean of squared residuals: 0.03509357
                % Var explained: 81.5

现在当我使用这个模型来预测测试集时。

    test = read.csv('testing_data.csv',header=F)
    predict(model,test,type="response")

它为所有测试数据集提供 NA 。 当我尝试将它用于训练数据集时,它仍然给我同样的结果。这是我完全没想到的。

当我跑步时

    predict(model,new_data=test,type="response") 

    predict(model,new_data=train,type="response") 

返回对象中的袋外预测。这意味着没有给出数据。 我应该怎么做才能得到预测?之后,我还想找到预测的准确性或性能。

【问题讨论】:

    标签: r machine-learning random-forest prediction


    【解决方案1】:

    我目前也遇到了同样的问题。 This answer 已经帮助我确定了 NA 预测概率的原因。简短(错误)答案:您的特征(或预测变量)中有 NA。

    我还在为其余的建模过程寻找解决方案。当我有足够的信息来解决您的其余问题时,我会回来更新此答案。

    伦巴...

    【讨论】:

      猜你喜欢
      • 2020-03-21
      • 2021-12-08
      • 2018-11-25
      • 2022-12-10
      • 2013-09-20
      • 2013-07-13
      • 1970-01-01
      • 1970-01-01
      • 2021-12-23
      相关资源
      最近更新 更多