The double coefficients sklearn.svm.SVC in setting up multiclasses are difficult to interpret. The scikit-learn documentation has an explanation. Sklearn.svm.SVC uses libsvm for calculations and uses the same data structure for double coefficients. Another explanation of the organization of these coefficients is in the FAQ . In the case of the coefficients that you find in the installed SVC classifier, the interpretation is as follows:
Supported vectors identified by SVC belong to a specific class. In double coefficients, they are ordered according to the class to which they belong. Given an established SVC rating, e.g.
from sklearn.svm import SVC
svc = SVC()
svc.fit(X, y)
you will find
svc.classes_
svc.n_support_
. , , n_classes-1 --, . , vs-one.
support_indices = np.cumsum(svc.n_support_)
svc.dual_coef_[0:support_indices[0]] # < ---
svc.dual_coef_[support_indices[1]:support_indices[2]]
...
svc.dual_coef_[support_indices[n_classes - 2]:support_indices[n_classes - 1]]
0, 1,..., n-1 vs-one. , , n_classes - 1 . , , , . , .
, , , , , "" . .
from sklearn.svm import SVC
svc = SVC(kernel="linear")
svc.fit(X, y)
svc.coef_
((n_class * (n_class -1)/2), n_features) .
doc :
class 0 vs class 1
class 0 vs class 2
...
class 0 vs class n-1
class 1 vs class 2
class 1 vs class 3
...
...
class n-2 vs class n-1