svmscikit-learn

Can SVC give different results? [scikit-learn v0.14]


I'm noticing that given the same feature table (training data) and feature vector for an SVC, I am getting different results for the predict_proba output.

Is this expected behavior for an SVC or should I be getting consistent results?


Solution

  • I think this is caused by the fact that libsvm is calibrating probabilities using cross-validation on random folds of the dataset. In recent versions of sklearn (0.14.1+), passing the random_state=0 as constructor param should fix the PRNG seed used internally by libsvm. If it does not fix the outcome, please feel free to open github issue with a minimalistic reproduction script.