Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[MRG + 3] OneVsRestClassifier: don't expose predict_proba and decision_function if base estimator doesn't support them #7812
Currently OneVsRestClassifier has predict_proba and decision_function methods even if base estimator doesn't have them. This makes it harder to check if an estimator supports predict_proba or not because it is not enough to run
In this PR it is changed, so that OneVsRestClassifier is more similar to Pipeline: if base estimator doesn't provide predit_proba or decision_function then OneVsRestClassifier also doesn't provide them.
It is not 100% backwards compatible: AttributeError is raised earlier, on ovr.decision_function / ovr.predict_proba access, not when these methods are called.