-
Notifications
You must be signed in to change notification settings - Fork 36
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
Active ranking #394
base: master
Are you sure you want to change the base?
Active ranking #394
Conversation
import numpy as np | ||
from typing import Callable, List, Any | ||
from dataclasses import dataclass | ||
from collections import defaultdict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the isort
error.
Maybe you need to reinstall the pre-commit hooks? Something like pre-commit install
when the repo is the current directory. If I right, you'll need to re-run the pre-commits afterwards to make sure it applies the changes :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides that the Jenkins seems to pass (after a rebuilt)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
General comment, do you use this code to evaluate your model?
I wonder if it indeed should be under eval/metrics?
If it should, I suggest moving it to eval/metrics/lib which is used for lower-level metrics functionality.
raise ValueError(f"Unknown method: {method}") | ||
|
||
|
||
if __name__ == "__main__": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider converting it to unittest.
return global_ranking | ||
|
||
|
||
if __name__ == "__main__": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider converting it to unittest
def __init__( | ||
self, | ||
items: List[Any], | ||
compare_pairwise_fn: Callable[[Any, Any], bool], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share some details about the expected arguments of this function?
helper utilities to rank items based on either:
The user is expected to supply such callable, and the helper functions added in this PR will call it iteratively to predict the overall ranking of the entire provided set.