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

F1, precision & recall for multi-class classification #772

Closed
sandervh14 opened this issue May 8, 2024 · 2 comments
Closed

F1, precision & recall for multi-class classification #772

sandervh14 opened this issue May 8, 2024 · 2 comments

Comments

@sandervh14
Copy link

sandervh14 commented May 8, 2024

Is your feature request related to a problem? Please describe.
I am evaluating a multi-class classification case. The values in the target column and prediction columns can be 0, 1, 2, 3 or 4.
The FScore, Precision and Recall calculation results in the following error:

java.lang.IllegalArgumentException: Precision can only be applied to binary classification: 1000

	at smile.validation.metric.Precision.of(Precision.java:54)
	at smile.validation.metric.FScore.of(FScore.java:90)
	at smile.validation.metric.FScore.score(FScore.java:47)

Describe the solution you'd like
Could you implement this, please? Calculating precision and recall for multi-class classification should be possible.

Describe alternatives you've considered
Not applicable.

Additional context
Not applicable.

@sandervh14 sandervh14 changed the title Precision for multi-class classification F1, precision & recall for multi-class classification May 8, 2024
@haifengl
Copy link
Owner

haifengl commented May 9, 2024

Sure, we will add support for multi class. BTW, smile.deep.metric package precision and recall support macro-, micro-, and weighted metrics of multi-class data.

@haifengl
Copy link
Owner

It is added to master branch now. See tests for examples.

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

2 participants