k_fold 样本 SVM 的价值下降 class
k_fold value making fell out of the sample SVM class
我对 C# 中 SVM class 的 k_fold 值有疑问(使用 emgucv)。所有的数字值都只是例外,如下所示:
Emgu.CV.Util.CvException was unhandled HResult=-2146233088
Message=OpenCV: While cross-validation one or more of the classes have
been fell out of the sample. Try to enlarge
Source=Emgu.CV ErrorMessage=While cross-validation one or more of
the classes have been fell out of the sample. Try to enlarge
放大/更改 k_fold 值无用。请帮我解决它们?
用它来解决model.Train(datalatih, kelas, null, null, s)
。这是我的代码
using (SVM model = new SVM())
{
SVMParams s = new SVMParams();
s.KernelType = Emgu.CV.ML.MlEnum.SVM_KERNEL_TYPE.LINEAR;
s.SVMType = Emgu.CV.ML.MlEnum.SVM_TYPE.C_SVC;
s.C = 1;
s.TermCrit = new MCvTermCriteria(100, 0.00001);
// Lakukan pelatihan
model.Train(datalatih, kelas, null, null, s);
// Tes Uji SVM
for (int i = 0; i < 30; i++)
{
datauji.Data[0, i] = uji[i];
}
float hasil = model.Predict(datauji);
return Tuple.Create((int)hasil);
}
我对 C# 中 SVM class 的 k_fold 值有疑问(使用 emgucv)。所有的数字值都只是例外,如下所示:
Emgu.CV.Util.CvException was unhandled HResult=-2146233088
Message=OpenCV: While cross-validation one or more of the classes have been fell out of the sample. Try to enlarge
Source=Emgu.CV ErrorMessage=While cross-validation one or more of the classes have been fell out of the sample. Try to enlarge
放大/更改 k_fold 值无用。请帮我解决它们?
用它来解决model.Train(datalatih, kelas, null, null, s)
。这是我的代码
using (SVM model = new SVM())
{
SVMParams s = new SVMParams();
s.KernelType = Emgu.CV.ML.MlEnum.SVM_KERNEL_TYPE.LINEAR;
s.SVMType = Emgu.CV.ML.MlEnum.SVM_TYPE.C_SVC;
s.C = 1;
s.TermCrit = new MCvTermCriteria(100, 0.00001);
// Lakukan pelatihan
model.Train(datalatih, kelas, null, null, s);
// Tes Uji SVM
for (int i = 0; i < 30; i++)
{
datauji.Data[0, i] = uji[i];
}
float hasil = model.Predict(datauji);
return Tuple.Create((int)hasil);
}