OpenCV 中的 SVM:如何处理不平衡数据?

SVM in OpenCV: how to handle unbalance data?

例如我有2个类的分类问题,但是数据是倾斜的(不同类的数据样本是成比例的1:10)

如何使用 SVM 处理不平衡数据?

我没有找到不同权重的参数 类 (OpenCV seems have no parameters for this?)

它在 CvSVMParams::CvSVMParams 中有 class_weights 个参数。

class_weights – Optional weights in the C_SVC problem , assigned to particular classes. They are multiplied by C so the parameter C of class #i becomes class_weights_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.