我正在尝试训练大约 15 个机器学习模型,使用食谱(用于一致的预处理)和插入符号(用于一致的训练)。唯一两个始终给我错误“有问题;所有准确度指标值都丢失”的模型在partykit 包中——cforest 和 ctree。下面我使用来自 mlbench 的 PimaIndiansDiabetes 数据集显示错误。
my_rec <- recipe(diabetes ~ ., data = PimaIndiansDiabetes) %>%
step_dummy(all_nominal(), -diabetes)%>%
step_nzv(all_predictors())
fitControl5 <- trainControl(summaryFunction = twoClassSummary,
verboseIter = TRUE,
savePredictions = TRUE,
sampling = "smote",
method = "repeatedcv",
number= 5,
repeats = 1,
classProbs = TRUE)
dtree5 <- train(my_rec, data = PimaIndiansDiabetes,
method = "cforest",
metric = "Accuracy",
tuneLength = 8,
trainControl = fitControl5)
note: only 7 unique complexity parameters in default grid. Truncating the grid to 7 .
Something is wrong; all the Accuracy metric values are missing:
Accuracy Kappa
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 :7 NA's :7
Error: Stopping
In addition: There were 50 or more warnings (use warnings() to see the first 50)
下面是方法 ctree 的代码
dtree6 <- train(my_rec, data = PimaIndiansDiabetes,
method = "ctree",
metric = "Accuracy",
tuneLength = 8,
trainControl = fitControl5)
Something is wrong; all the Accuracy metric values are missing:
Accuracy Kappa
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 :8 NA's :8
Error: Stopping
In addition: There were 50 or more warnings (use warnings() to see the first 50)
我将衷心感谢您的帮助!