Open
Description
Hello,
I've been exploring the predictor_proba function defined in sklearn.py at this location and I have some suggestions to improve its functionality and usability.
- Clarify the Function's Docstring: The current docstring mentions a parameter
num_targets
which is not present in the function signature. It might be beneficial for future users if the documentation accurately reflects the function's parameters and intended use. - Handling Multi-class Predictions: For models that predict probabilities across multiple classes, flattening the output might not always be desirable. It could be more useful to return the original array structure to preserve the relationship between classes and probabilities.
- Error Handling for predict_proba Method: Not all Scikit-Learn estimators have a predict_proba method. Adding a check to ensure that the estimator passed to predictor_proba supports this method could prevent runtime errors and improve user experience.