当我运行下面的代码时,R崩溃。如果我在调用train中注释掉tuneGrid行,则不会发生崩溃。我已经尝试过使用另一个数据集,并且仍然崩溃R. Crash消息是 R会话中止 R遇到致命错误 会话终止 开始新会话。R使用插入符号和方法进行训练时崩溃= gamLoess
的代码是:
library(splines)
library(foreach)
library(gam)
library(lattice)
library(ggplot2)
library(caret)
# crashes when I uncomment the tuneGrid = tuneGrid line
Set_seed_seed <- 100
data_set <- diamonds[, c(1, 5, 6, 7, 8, 9, 10)]
data_set <- data_set[1:1000,]
formula <- price ~ carat + depth + table + x + y + z
training_control <- trainControl(method = "cv", allowParallel = FALSE)
tune_grid <- expand.grid(span = seq(0.1, 0.9, length = 9), degree = seq(1, 2, length = 2))
set.seed(Set_seed_seed)
GAM_model <- train(formula,
data = data_set,
method = "gamLoess",
tuneGrid = tune_grid,
trControl = training_control
)
这发生在R3.2.1和3.2.2,使用R工作室。
在R gui中,也会崩溃。
我有这种情况发生在两台电脑,一个运行Windows 7和一和Windows 8。 – Matt