TypeError: predict_proba not available for this estimator
7 Dec 2025
1 min read
TypeError: predict_proba unavailable
$ python -c "from sklearn.svm import SVC; SVC().predict_proba([[0,1]])"
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'SVC' object has no attribute 'predict_proba'
Why this happens
- Estimator doesn’t implement probability estimates by default.
Fix
- Use
probability=TrueforSVC, or choose an estimator that supports it.
Wrong code
from sklearn.svm import SVC
SVC().predict_proba([[0,1]])
Fixed code
from sklearn.svm import SVC
clf = SVC(probability=True)
clf.fit([[0,1],[1,0],[0.5,0.5]],[0,1,0])
print(clf.predict_proba([[0.2,0.8]]))