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

(WIP) Tie-breaking extensibility #110

Merged
merged 6 commits into from
May 28, 2020
Merged

(WIP) Tie-breaking extensibility #110

merged 6 commits into from
May 28, 2020

Conversation

Nzteb
Copy link
Contributor

@Nzteb Nzteb commented May 28, 2020

Tie-breaking options/documentation, see #96

Copy link
Member

@rgemulla rgemulla left a comment

Choose a reason for hiding this comment

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

Look good, only small changes requested.

kge/config-default.yaml Outdated Show resolved Hide resolved
kge/config-default.yaml Outdated Show resolved Hide resolved
# ['a': score 10, 'b': score 10, 'c': score 10, 'd': score 11]. Correct query
# answer: 'a'. Possible options are:
# - rounded_mean_rank: Calculate the rounded mean rank. The final rank is calculated
# as 1 + #scores_higher + #answers_with_same_score // 2,
Copy link
Member

Choose a reason for hiding this comment

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

write as round_up(...), use /2. Easier to read this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have addressed the review. Only here I used round_down() as this matches X//Y.

kge/config-default.yaml Outdated Show resolved Hide resolved
kge/config-default.yaml Outdated Show resolved Hide resolved
kge/job/entity_ranking.py Outdated Show resolved Hide resolved
kge/job/entity_ranking.py Outdated Show resolved Hide resolved
# Correct query answer: 'a'. Possible options are:
# - rounded_mean_rank: Calculate the rounded mean rank. The final rank is
# calculated as 1 + #scores_higher +
# round_down(#answers_with_same_score / 2). In the example,
Copy link
Member

Choose a reason for hiding this comment

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

We always round up to err on the worst_rank side.

Copy link
Member

Choose a reason for hiding this comment

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

Ahh, I read this as "other_answers_with_same_score". Prehaps clarifiy: rounded (up) mean rank,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm just describing what the code does. And in ranks + num_ties // 2 , "//" rounds the rank down?

Copy link
Member

Choose a reason for hiding this comment

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

See, you are confused as well. We round the number of ties (>=1) down, which corresponds to rounding the mean rank up. E.g., if there is one other answer with he same score than the correct one, then num_ties=2. We round down num_ties/2, but this corresponds to rounding up the mean rank. Perhaps its best to not show this computation here, it's only conusing. Mean rank rounded up is clear enough.

# 1 + 1 + round_down(3 / 2) = 3.
# - best_rank: Assign the lowest rank for the correct answer. The final
# rank for answer (s, p, 'a') is 2. We do not recommend to
# use this option, it leads to misleading results.
Copy link
Member

Choose a reason for hiding this comment

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

To weak. Write DO NOT USE THIS OPTION. It's the reason for a number of problematic results/papers

@@ -13,6 +13,11 @@ class EntityRankingJob(EvaluationJob):

def __init__(self, config: Config, dataset: Dataset, parent_job, model):
super().__init__(config, dataset, parent_job, model)
self.config.check(
"eval.entity_ranking.tie_handling",
Copy link
Member

Choose a reason for hiding this comment

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

Why not: eval.tie_handling. It makes sense for all ranking tasks, even the ones we still plan to implement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that also makes sense. So dropping the key 'entity_ranking' completely for now.

# misleading evaluation results.
# - rounded_mean_rank: Average between worst and best rank, rounded up
# (rounded fractional ranking). In example: 3.
tie_handling: rounded_mean_rank
Copy link
Member

Choose a reason for hiding this comment

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

How about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool!

@rgemulla rgemulla merged commit cf2a9b3 into uma-pi1:master May 28, 2020
@rgemulla
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants