gpt4 book ai didi

opencv - opencv(SVM)-参数nu超出范围

转载 作者:行者123 更新时间:2023-12-02 16:40:22 25 4
gpt4 key购买 nike

以下代码生成一个异常说:

One of arguments' values is out of range- the parameter nu must be between 0 and 1



我想知道为什么将它设置为0到1之间的值时会发生这种情况。
CvSVM svm;
CvParamGrid CvParamGrid_C(pow(2.0,-5), pow(2.0,15), pow(2.0,2));
CvParamGrid CvParamGrid_gamma(pow(2.0,-15), pow(2.0,3), pow(2.0,2));
CvParamGrid CvParamGrid_nu(0.4, 0.8,0.1);
const cv::Mat labelsMat(250, 1, CV_32FC1, labels);
const cv::Mat trainingDataMat(250,35, CV_32FC1, trainingData);
CvSVMParams paramz;
paramz.kernel_type = CvSVM::RBF; paramz.svm_type = CvSVM::NU_SVR;
paramz.term_crit = cvTermCriteria(CV_TERMCRIT_ITER,100,0.000001);
svm.train_auto(trainingDataMat, labelsMat, cv::Mat(), cv::Mat(), paramz, 5,
CvParamGrid_C, CvParamGrid_gamma, CvSVM::get_default_grid(CvSVM::P),
CvParamGrid_nu,vSVM::get_default_grid(CvSVM::COEF),
CvSVM::get_default_grid(CvSVM::DEGREE), true);
paramz = svm.get_params();

有人可以帮忙吗?

最佳答案

关于opencv - opencv(SVM)-参数nu超出范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25047899/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com