我有一个关于支持向量机权重的简单问题。我正在进行二元分类。我想为两个类(class)设置不同的权重。我的代码是这样的
Mat weights = (Mat_<double>(2,1)<<1,2);
CvMat weight = weights;
param.class_weights = &weight;
我想知道哪个权重适用于哪个类(class)?我不是从 opencv 文档中得到的。谢谢。
classWeights – Optional weights in the C_SVC problem , assigned to particular classes. They are multiplied by C so the parameter C of class #i becomes classWeights(i) * C. Thus these weights affect the misclassification penalty for different classes. The larger weight, the larger penalty on misclassification of data from the corresponding class.
我是一名优秀的程序员,十分优秀!