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

Code questions #7

Open
OnYuKang opened this issue May 30, 2019 · 2 comments
Open

Code questions #7

OnYuKang opened this issue May 30, 2019 · 2 comments

Comments

@OnYuKang
Copy link

Hi :)
I have a small question in the code.
I do not know why it has"-1" in the below part.

_out = tmp_out[s]-1

_out = tmp_out[s]-1

Thank you!

@DoubleYing
Copy link

大概是输出的label是从0开始计数的吧

@if-zz
Copy link
Contributor

if-zz commented Jul 6, 2019

About your questions, because the index 0 in item dictionary is for padding and it shouldn't be used to computing a recommendation score, you can see we use embe_dict[1:] to calculate the recommendation score for each item . So when evaluating the results, the true index for each target item should minus 1 to get its corresponding score in the score list,that's why you see _out = tmp_out[s]-1

For example, the index of first item in embedding dictionary is 1, but the index of its recommendation score in score list is 0.

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

3 participants