Predict probabilities using SVM
问题 I wrote this code and wanted to obtain probabilities of classification. from sklearn import svm X = [[0, 0], [10, 10],[20,30],[30,30],[40, 30], [80,60], [80,50]] y = [0, 1, 2, 3, 4, 5, 6] clf = svm.SVC() clf.probability=True clf.fit(X, y) prob = clf.predict_proba([[10, 10]]) print prob I obtained this output: [[0.15376986 0.07691205 0.15388546 0.15389275 0.15386348 0.15383004 0.15384636]] which is very weird because the probability should have been [0 1 0 0 0 0 0 0] (Observe that the sample