def predict_proba(self, X):
if "predict_proba" in dir(self.best_clf):
return self.best_clf.predict_proba(X)
elif "decision_function" in dir(self.best_clf):
return softmax(self.best_clf.decision_function(X))
else:
raise ValueError("Base classifiers must be able to estimate probabilities.")
After Change
raise ValueError("Base classifier must support the predict_proba function.")
predicted_proba = self.best_clf.predict_proba(X)
return predicted_proba
def _check_is_fitted(self):
Verify if the estimator algorithm was fitted.
Raises an error if it is not fitted.