【问题标题】:Error "Something is wrong; all the RMSE metric values are missing" using SBC from frbs package in Caret使用 Caret 中 frbs 包中的 SBC 出现错误“出现问题;所有 RMSE 度量值都丢失”
【发布时间】:2017-04-11 19:57:15
【问题描述】:

我一直在尝试使用 Caret for R 中“frbs”包中的“SBC”方法来拟合模型。我在 SO 中看到了针对不同包的类似问题并尝试了解决方案,但它们似乎不起作用就我而言。我提供了一个代码 sn-p 用于使用 iris 数据集的可重现性。

library(caret)
data("iris")
grid<-expand.grid(r.a = c(0.5),
                                     eps.high = c(0.5),
                                     eps.low = c(0))

Fit <- train(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, data = iris,
                                 method = "SBC", 
                               #  trControl = fitControl,
                                 tuneGrid=grid,
                                 verbose = TRUE)

Fit$results

得到的错误是:

Something is wrong; all the RMSE metric values are missing:
      RMSE        Rsquared  
 Min.   : NA   Min.   : NA  
 1st Qu.: NA   1st Qu.: NA  
 Median : NA   Median : NA  
 Mean   :NaN   Mean   :NaN  
 3rd Qu.: NA   3rd Qu.: NA  
 Max.   : NA   Max.   : NA  
 NA's   :3     NA's   :3    
Error in train.default(x, y, weights = w, ...) : Stopping
In addition: There were 50 or more warnings (use warnings() to see the first 50)

我检查了警告(),它显示“Resample17 的模型拟合失败:ra=0.5,eps.high=0.5,eps.low=0 frbs.learn 中的错误(data.train = structure(c(3.5, 3, 3.2, 3.1, 3.4, 3.4, : ....."。我什至尝试过单独安装 frbs 包。此外,我确保变量的类不是因素,即使对于我的数据也是如此。

我的问题是如何修复此错误以及为什么会发生此错误。任何帮助将不胜感激。

提前致谢。

【问题讨论】:

  • 不可重现,它在我的机器上按预期工作
  • 尝试将 predictor 变量强制转换为 factor 类型,看看是否可行?
  • @sandipan 那么这个错误可能与机器有关吗?同样的代码也在我同事的系统上运行。还有什么我可以尝试的吗?
  • @Aramis7d 由于该方法用于回归,将其转换为因子显示错误Error in train.default(x, y, weights = w, ...) : wrong model type for classification
  • 可能,您可能想比较一下您和您同事的 R 版本/插入符号版本/OS 版本等。

标签: r r-caret


【解决方案1】:

感谢 Max Kuhn,问题已得到解决。 Caret 的 github 页面中的解决方案链接为here

【讨论】:

    猜你喜欢
    • 2015-08-14
    • 2015-10-19
    • 2020-02-21
    • 2016-06-01
    • 1970-01-01
    • 2020-11-30
    • 2021-04-01
    • 2016-07-10
    • 1970-01-01
    相关资源
    最近更新 更多