Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiclass support in precision_recall_curve #28548

Open
isacarnekvist opened this issue Feb 28, 2024 · 4 comments · May be fixed by #28890
Open

Multiclass support in precision_recall_curve #28548

isacarnekvist opened this issue Feb 28, 2024 · 4 comments · May be fixed by #28890

Comments

@isacarnekvist
Copy link

Describe the workflow you want to enable

i would like to add multiclass support to precision_recall_curve.

Describe your proposed solution

  • Add check in the beginning to check if multiclass or binary
  • Add weighting argument for micro, macro, weighted
  • Implement _multiclass_clf_curve

Describe alternatives you've considered, if relevant

No response

Additional context

I can implement the functionality, but I would like to hear any comments before starting

@isacarnekvist isacarnekvist added Needs Triage Issue requires triage New Feature labels Feb 28, 2024
@isacarnekvist
Copy link
Author

y_true would be a label array (num_samples, ) or one hot matrix (num_samples, num_classes)
y_pred would be matrix of scores (num_samples, num_classes)

@glemaitre glemaitre removed the Needs Triage Issue requires triage label Mar 11, 2024
@glemaitre
Copy link
Member

I think that we should be extending the scope to the ROC curve as well. An example where we do compute the different averages or handle multiclass is this example: https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html#sphx-glr-auto-examples-model-selection-plot-roc-py

This would be good to have a simpler API to achieve the same results.

@lorentzenchr
Copy link
Member

Without a scientific / statistical justification (e.g. literature), I'm hesitant to add such aggregations because, to me, it is not clear what such aggregations produce and how to interprete them. So my opposite proposal is to remove that part from the examples.

@isacarnekvist isacarnekvist linked a pull request Apr 25, 2024 that will close this issue
@isacarnekvist
Copy link
Author

Hi! I have a PR for this feature now, all tests passing etc! Sounds good to include for ROC curve in the future, although I limited the scope of this particular PR to PR (!) only :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants