-
Notifications
You must be signed in to change notification settings - Fork 148
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
Improve computation of ranking related metrics #530
Comments
One way to speed up evaluation is to do sampling for negative items. This usually makes sense when the set of items is huge and we can't afford to rank all of them. The slowness is probably caused by cornac/cornac/models/recommender.py Line 285 in 5747077
Sketch idea is to let user define how many items they want to use as negatives (e.g., 100), then we do sampling somewhere here: cornac/cornac/eval_methods/base_method.py Line 195 in 5747077
After that, where are two ways to continue:
A smarter way is adaptive, analyzing both and set a flag to pick one or the other for subsequent iterations. Just something coming on top of my head at the moment. Let's discuss if anyone has more clever ideas. |
My thought on this is because of the cornac/cornac/models/recommender.py Line 192 in 5747077
where we only evaluate users one by one. Will doing batch user evaluation be faster for GPU-based models? |
Most of the GPU-based models only utilize GPU during training but not evaluation. Their predictive functions tend to be dot-product between user and item embedding which is quite efficient with Numpy. It wouldn't hurt to have, let's say |
Some models with a large number of parameters cannot generate scores for a large number of items (using batch scoring function) due to insufficient memory. Especially, when the scoring function requires to compute the score for every pairs of user and item that leads to scalability issue when ranking the full set of items. I prefer to add an optional parameter to specify the number of negative samples for ranking evaluation. This has been applied in many research. Of course, we need to ensure reproducibility by specifying a random seed for whatever pseudo-random generator was used.
|
@lthoang @hieuddo @darrylong it seems that we can have an option for negative sampling during evaluation. Anyone wants to take a lead on this improvement? 😃 |
Description
Certain ranking metrics currently take a considerably long time for a single calculation output.
Other Comments
It could be due to:
Some slow calculation in the
ranking_eval
function.cornac/cornac/eval_methods/base_method.py
Line 174 in 5747077
More testing is required to determine which part is to be optimised.
How the
score
function calculates during evaluation on a user-by-user basis.cornac/cornac/models/recommender.py
Line 192 in 5747077
Further discussion to find how we could improve performance would be great. :)
Thank you all!
The text was updated successfully, but these errors were encountered: