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

>1 item next basket prediction #1

Closed
davejm opened this issue Jun 19, 2017 · 1 comment
Closed

>1 item next basket prediction #1

davejm opened this issue Jun 19, 2017 · 1 comment

Comments

@davejm
Copy link

davejm commented Jun 19, 2017

How might one go about changing this to predict next baskets of multiple items?

@khesui
Copy link
Owner

khesui commented Jun 22, 2017

I do not provide friendly API for prediction. But it's not difficult to solve your problem.
Please refer to the code below

scores = self.compute_x_batch(u, b_tm1) 
if i == scores.argmax():
    correct_count += 1

The basic idea of "prediction" in FPMC (or BPR) is to select items with high scores. That is, the prediction is a rank list. You can get the list by sorting indices using values as keys.
The size of a next basket depends on you.

@davejm davejm closed this as completed Oct 4, 2017
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