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

Show scores in outputs of suggest, eval and index with 4 decimals #704

Merged
merged 2 commits into from
May 16, 2023

Conversation

juhoinkinen
Copy link
Member

@juhoinkinen juhoinkinen commented May 12, 2023

Currently the output of annif suggest (to stdout) and annif index (to document.annif file) is e.g. as follows:

<http://www.yso.fi/onto/yso/p109998>	Röyttä (Ii)	0.4971785247325897
<http://www.yso.fi/onto/yso/p38304>	stabiilius (muuttumattomuus)	0.4472784399986267
<http://www.yso.fi/onto/yso/p10546>	hydrodynamiikka	0.4472784399986267
<http://www.yso.fi/onto/yso/p2048>	jääliikenne	0.44725048542022705
<http://www.yso.fi/onto/yso/p4911>	laivat	0.42701175808906555
<http://www.yso.fi/onto/yso/p12284>	hinaajat	0.40847617387771606
<http://www.yso.fi/onto/yso/p19211>	hydrostatiikka	0.3946342170238495
<http://www.yso.fi/onto/yso/p17953>	rahtilaivat	0.37881672382354736
<http://www.yso.fi/onto/yso/p16317>	höyrylaivat	0.36528536677360535
<http://www.yso.fi/onto/yso/p3976>	koneistot	0.3235071897506714

And the output of annif eval:

Precision (doc avg):          	0.12500000000000003
Recall (doc avg):             	0.2593537414965987
F1 score (doc avg):           	0.16722522342270243
Precision (subj avg):         	0.0006919161493665802
Recall (subj avg):            	0.0005637320849872252
F1 score (subj avg):          	0.00058845613207959
Precision (weighted subj avg):	0.42108585858585856
Recall (weighted subj avg):   	0.26515151515151514
F1 score (weighted subj avg): 	0.3055555555555555
Precision (microavg):         	0.125
Recall (microavg):            	0.26515151515151514
F1 score (microavg):          	0.16990291262135923
F1@5:                         	0.17080142080142083
NDCG:                         	0.23108215630054474
NDCG@5:                       	0.19264987111091614
NDCG@10:                      	0.23108215630054474
Precision@1:                  	0.21428571428571427
Precision@3:                  	0.21428571428571425
Precision@5:                  	0.17142857142857149
True positives:               	35
False positives:              	245
False negatives:              	97
Documents evaluated:          	28

The very many decimals make reading the outputs a bit hard, but they don't offer any significant value.

This PR makes the shown scores to be rounded to 4 decimal places.

@juhoinkinen juhoinkinen added this to the 1.0 milestone May 12, 2023
@sonarcloud
Copy link

sonarcloud bot commented May 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (2d1d3ce) 99.66% compared to head (ada1419) 99.66%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #704   +/-   ##
=======================================
  Coverage   99.66%   99.66%           
=======================================
  Files          89       89           
  Lines        6288     6293    +5     
=======================================
+ Hits         6267     6272    +5     
  Misses         21       21           
Impacted Files Coverage Δ
annif/cli.py 100.00% <100.00%> (ø)
annif/cli_util.py 99.00% <100.00%> (+0.01%) ⬆️
tests/test_cli.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@juhoinkinen juhoinkinen marked this pull request as ready for review May 15, 2023 13:31
Copy link
Member

@osma osma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this. LGTM.

@juhoinkinen juhoinkinen merged commit 5f670e7 into main May 16, 2023
@juhoinkinen juhoinkinen deleted the scores-decimals-in-command-outputs branch May 16, 2023 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants