After training the SVM classifier, I am using predict_proba() to get the probability for the classes of the data. But it gives error "AttributeError: predict_proba is not available when probability=False".
>>> clf.predict_proba(X_test)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\pkumar81\Anaconda2\lib\site-packages\sklearn\svm\base.py", line 596, in _predict_proba
raise NotFittedError("predict_proba is not available when fitted "
sklearn.exceptions.NotFittedError: predict_proba is not available when fitted with probability=False
I am using the following code:
>>> from sklearn import svm
>>> clf = svm.SVC()
>>> clf.fit(X_test, y_test)
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,
decision_function_shape='ovr', degree=3, gamma='auto', kernel='rbf',
max_iter=-1, probability=False, random_state=None, shrinking=True,
tol=0.001, verbose=False)
>>> clf.predict_proba(X_test)