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

How to get prediction score #61

Open
niccola-tartaglia opened this issue May 16, 2023 · 3 comments
Open

How to get prediction score #61

niccola-tartaglia opened this issue May 16, 2023 · 3 comments

Comments

@niccola-tartaglia
Copy link

niccola-tartaglia commented May 16, 2023

Similar question as this in this post #59.

That post uses __rank_slates to obtain predicted ranks for y but that doesn't seem to be correct to me. When you look at the function it just returns the original y vector after it has been re orderd (or reranked) but not the predicted ranks.

Is there a function that returns the predicted ranks? or get a predicted score and then generate the rank ourselves?

@niccola-tartaglia
Copy link
Author

Another post #44 has mentioned the use of the score function, but I don't understand how to use this from the main script after a model has been trained.

@kretes
Copy link
Contributor

kretes commented May 17, 2023

Here is a colab showing the usage of allrank for getting scores for a dataset.

https://colab.research.google.com/drive/1YqtomZ1KI09mOeNDhHTpae-7HRi5Lyh_?usp=sharing

It is basically run of

  1. generate_dummy_data
  2. train a model
  3. score a dataset using a model

parts 1 & 2 are the same as what happens in https://github.com/allegro/allRank/blob/master/scripts/run_example.sh

part 3 is adaptation of

https://github.com/allegro/allRank/blob/master/allrank/rank_and_click.py
and
https://github.com/allegro/allRank/blob/master/allrank/inference/inference_utils.py
to just do scoring and return.

It currently requires a normal dataset (with Y values, since they are used for masking), even though for inference we one shouldn't be forced to provide Y_true

@niccola-tartaglia LMK if that helps!

@niccola-tartaglia
Copy link
Author

Thank you so much for sharing this, I will go through this example!!

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

2 participants