在 Caret 中使用来自 frbs 包的 SBC 时出错 "Something is wrong; all the RMSE metric values are missing"
Error "Something is wrong; all the RMSE metric values are missing" using SBC from frbs package in Caret
我一直在尝试使用 Caret for R 中 'frbs' 包中的 'SBC' 方法来拟合模型。我在 SO 中看到了针对不同包的类似问题并尝试了解决方案,但它们在我的情况下似乎不起作用。我提供了使用 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)
我检查了 warnings(),它显示 "model fit failed for Resample17: r.a=0.5, eps.high=0.5, eps.low=0 Error in frbs.learn(data.train = structure(c(3.5, 3, 3.2, 3.1, 3.4, 3.4, : ....."。我什至尝试过单独安装 frbs 包。我还确保变量的 类 不是因素,即使对于我的数据也是如此。
我的问题是如何修复此错误以及为什么会出现此错误。任何帮助将不胜感激。
提前致谢。
问题已解决,感谢 Max Kuhn。 Caret 的 github 页面中的解决方案 link 给出 here。
我一直在尝试使用 Caret for R 中 'frbs' 包中的 'SBC' 方法来拟合模型。我在 SO 中看到了针对不同包的类似问题并尝试了解决方案,但它们在我的情况下似乎不起作用。我提供了使用 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)
我检查了 warnings(),它显示 "model fit failed for Resample17: r.a=0.5, eps.high=0.5, eps.low=0 Error in frbs.learn(data.train = structure(c(3.5, 3, 3.2, 3.1, 3.4, 3.4, : ....."。我什至尝试过单独安装 frbs 包。我还确保变量的 类 不是因素,即使对于我的数据也是如此。
我的问题是如何修复此错误以及为什么会出现此错误。任何帮助将不胜感激。
提前致谢。
问题已解决,感谢 Max Kuhn。 Caret 的 github 页面中的解决方案 link 给出 here。