It seems that for sklearn.svm.SVC
, different scaling of sample_weight
makes the classifier behaves differently. Is it correct? If yes, how does the sample_weight
work?
sample_weights = np.ones((X.shape[0])) / X.shape[0]
from sklearn.svm import SVC
clf0 = SVC()
clf0.fit(X, y, sample_weights*10)
plt.subplot(121)
visualize_result(clf0, X, y)
clf1 = SVC()
clf1.fit(X, y, sample_weights*5)
plt.subplot(122)
visualize_result(clf1, X, y)
And the result is