ENH Add `zero_division` parameter for `accuracy_score`
Introduce the zero_division parameter to the accuracy_score function when y_true and y_pred are empty.
Reference Issues/PRs
Make zero_division parameter consistent in the different metric #29048 (Task-1)
What does this implement/fix? Explain your changes.
I have verified the lengths of the variables "y_true" and "y_pred." If both lengths are 0, I have generated an output based on the value of the "zero_warning" variable.
Any other comments?
✔️ Linting Passed
All linting checks passed. Your pull request is in excellent shape! ☀️
Hi @Jaimin020,
regarding the CodeCov failures: you need to add accuracy_score to the tests in test_classification.py. The output of the CI seems not very helpful here however. Normally, the precise lines of the uncovered code should show up in the "Files changed" tab.
Hii, @StefanieSenger
I have made all the changes you mentioned.
Hii, @StefanieSenger and @glemaitre
I've implemented all the changes suggested by @StefanieSenger. @glemaitre, please review this PR and let me know if any further modifications are needed.
Hii @glemaitre,
I have implemented all the changes you requested. Please review it.
LGTM @Jaimin020.
I quickly pushed a commit to merge main in the branch and just modify the message related to skipping the test that is rather a nitpick.
We will need a second approval.
Thanks @glemaitre for the quick update and merge with the main branch.