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

Known bug in scikit-learn's f1_score metric #97

Open
agmoore4 opened this issue Sep 10, 2024 · 1 comment
Open

Known bug in scikit-learn's f1_score metric #97

agmoore4 opened this issue Sep 10, 2024 · 1 comment

Comments

@agmoore4
Copy link

Related to #29734 (scikit-learn/scikit-learn#29734).

Scikit-learn's documentation states that the pos_label parameter is ignored in multiclass problems, but it isn't actually ignored. Since it defaults to pos_label=1, which isn't a label found in the dataset, the scoring fails every time, giving np.nan.

Setting pos_label=None explicitly would resolve the problem and have f1_score work as intended.

@agmoore4
Copy link
Author

This fix would be relevant in tutorials/text_class_example.py, which is used in the text module tutorial

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

No branches or pull requests

1 participant