Skip to content

Improvement Suggestion for predictor_proba Function in sklearn.py #1312

Open
@HJH0924

Description

@HJH0924

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.

  1. 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.
  2. 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.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions