简体   繁体   English

如何在sci-kit学习库中为一个类别惩罚SVM?

[英]How to penalize the SVM for one category in sci-kit learn library?

我一个班有10000个样本,而另一班只有3500个样本,这就是为什么我面临班级不平衡问题.sci-kit学习库中是否有SVM的任何惩罚版本?

In SVC, keyword class-weight in the fit method sets the parameter C to C*value where value>0 . 在SVC中, fit方法中的关键字class-weight将参数CC*value ,其中value>0

Actually, class weight is a dictionary of the form of class_label: value . 实际上, class weightclass_label: value形式的字典。

Refer http://scikit-learn.org/stable/modules/svm.html (sec: 1.4.1.3) 请参阅http://scikit-learn.org/stable/modules/svm.html (秒:1.4.1.3)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM