报错内容
Error in summary.connection(connection) : 链结不对
set.seed(825)
> gbmFit1 <- train(Class ~ ., data = training,
+ method = "gbm",
+ trControl = fitControl,
+ ## This last option is actually one
+ ## for gbm() that passes through
+ verbose = FALSE)
Error in summary.connection(connection) : 链结不对
原因分析
在使用boosting(助推法)
之前,使用svm
算法训练模型并使用foreach
并行化加速时导致环境变量冗余,所以清除即可。
env <- foreach:::.foreachGlobals
rm(list=ls(name=env), pos=env)
1] "allData" "bYears" "cl"
[4] "ctrl0" "dpmt" "dummies"
[7] "env" "factorForm" "factorPredictors"
[10] "fitControl" "fullset" "grantData"
[13] "grantYear" "highCorr" "holdout2008"
[16] "inTrain" "inTraining" "investCount"
[19] "investCountry" "investDept" "investDOB"
[22] "investDuration" "investFaculty" "investGrants"
[25] "investLang" "investPhD" "investPub"
[28] "isNZV" "nms" "noZV"
[31] "people" "pre2008" "pre2008Data"
[34] "predCorr" "raw" "reducedset"
[37] "RFCDcount" "SEOcount" "shortnames"
[40] "Sonar" "startTime" "summarized"
[43] "svmrGrid" "temp" "test2008"
[46] "testing" "tmp" "totalPub"
[49] "training" "training2" "vertical"
[52] "year2008" "year2008Data"
关于R语言train函数
错误的调试就到这里为止,如果各位同学有遇到其他的错误,欢迎在评论区留言,一起解决!