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

Class labels ratio alternative computation #14

Open
antonioagostino-bh opened this issue Jun 13, 2023 · 0 comments
Open

Class labels ratio alternative computation #14

antonioagostino-bh opened this issue Jun 13, 2023 · 0 comments

Comments

@antonioagostino-bh
Copy link

The COCOStats class has attributes describing the distribution of the class labels in a dataset. One of these attribute is stats.cat_nms_ratios, which returns a dictionary containing the ratios of the categories, using category names as keys. The formula used to compute these ratios can sometimes lead to results not corresponding to the real ratios. Sometimes class labels having zero occurrences in the dataset have a ratio greater than zero. I would like an alternative attribute or method which computes the classes distribution as the following code snippet does:

for cat_id in old_stats.cat_ids_ratios.keys():
    occurrencies[cat_id] = COCOStats(ch_old.filter_cats(cat_ids=cat_id)).nb_anns

old_numeric_ratios = {key: occurrencies[key] / total_anns_number for key in occurrencies.keys()}

The formula used above is the ratio among the total number of occurrences. In some cases this computation is preferred to what stats.cat_nms_ratios does.

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