scikit-learn / scikit-learn/scikit-learn
Improve `pos_label` switching for metrics
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 67.3k
- Forks
- 27.4k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 58
Description
Supercedes #26758
Switching pos_label for metrics, involves some manipulation for predict_proba (switch column you pass) and decision_function (for binary, multiply by -1) as you must pass the values for the positive class.
In discussions in #26758 we thought of two options:
- Add an example demonstrating what you need to do when switching
pos_label - Expose the (currently private) functions
_process_decision_functionand_process_predict_proba
This is a RFC to discuss if we prefer one, or both options.
cc @glemaitre and maybe @ogrisel ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the discussion in #26758 and the two private functions in sklearn/utils/_response.py: _process_decision_function and _process_predict_proba. Compare the proposed example and public-API options, then confirm the preferred direction and its expected behavior when switching pos_label for predict_proba and decision_function.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100