Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R(插入符号)在';replace=FALSE';_R_Svm_R Caret - Fatal编程技术网

R(插入符号)在';replace=FALSE';

R(插入符号)在';replace=FALSE';,r,svm,r-caret,R,Svm,R Caret,我正在尝试使用R中的插入符号包训练多项式支持向量机,并获得问题标题中所述的错误消息。我在谷歌上很难找到一个解决方案,不知道是否有人能指导我找到一个解决方案 我的代码在下面共享 Train_CTRL <- trainControl(method = "repeatedcv", number = 10, repeats = 5) SVM_Poly <- train(Degree~.,

我正在尝试使用R中的插入符号包训练多项式支持向量机,并获得问题标题中所述的错误消息。我在谷歌上很难找到一个解决方案,不知道是否有人能指导我找到一个解决方案

我的代码在下面共享

Train_CTRL <- trainControl(method = "repeatedcv", 
                           number = 10, repeats = 5)
SVM_Poly <- train(Degree~., 
                  data = Train_Set_Norm, 
                  method = "svmPoly",
                  trControl = Train_CTRL,
                  tuneLength = 1000)

Train\u CTRL错误非常简单。它表示,在您的数据集中,样本数少于1000
tuneLength
应小于数据集中每个组/类的样本数。由于您没有提供数据,我可以使用
iris
数据重现您的错误,如

library(caret)

Train_CTRL <- trainControl(method = "repeatedcv", 
                           number = 10, repeats = 5)
SVM_Poly <- train(Species~., 
                  data = iris, 
                  method = "svmPoly",
                  trControl = Train_CTRL,
                  tuneLength = 1000)
SVM_Poly <- train(Species~., 
                  data = iris, 
                  method = "svmPoly",
                  trControl = Train_CTRL,
                  tuneLength = 10)