SVM中的参数 class_weight的使用:
sklearn中
class_weight : {dict, 'balanced'}, optional
Set the parameter C of class i to class_weight[i]*C for
SVC. If not given, all classes are supposed to have
weight one.
The "balanced" mode uses the values of y to automatically adjust
weights inversely proportional to class frequencies in the input data
as ``n_samples / (n_classes * np.bincount(y))``
理解:两种方式来赋值:
1.class_weight ={key1:value1,key2:value2}
2.class_weight = 'balanced'