I use scikit-learn to train a SVC with 'poly'-Kernel and propability-paramter enabled.
Most of the time the prediction and the probability assigned to the prediction is correct. That means:
y_pred = self.clf_.predict(feat_scaled)[0] # y_pred=1
probs = self.clf_.predict_proba(feat_scaled)[0] # probs=[0.01, 0.9, 0.08, 0.01]
but sometimes the prediction and the probabilities are not the same:
y_pred = self.clf_.predict(feat_scaled)[0] # y_pred=2
probs = self.clf_.predict_proba(feat_scaled)[0] # probs=[0.8, 0.05, 0.1, 0.05]
As you can see the predcition should be class-0 since it has the largest probability but somehow it is classified as class-2.
What is happening here?