Comments (2)
Correct, you can predict the next item to a session by calling predict_next_batch
multiple times feeding it the items in your session and the same user (or session) id. Keep in mind that this will be slow, because predictions for every item are computed in every step. predict_next_batch
was designed for evaluating the model (by using evaluate_sessions_batch
) and not for providing actual predictions (later it was superseded by symbolic_predict
(that is used by evaluate_gpu
) which is even harder to use for getting the actual predictions). The public version of this algorithm doesn't directly support inferring recommendations to individual sessions (because it is intended to be used for reproducing earlier results, or as a baseline for other session-based algorithms).
In the above code, the first and second parameters of predict_next_batch
should be numpy arrays and not lists. It might work with lists of only one ID, but its best to stick with numpy arrays here.
As for which one is better item-to-item or item-to-session recommendations: item-to-item recommendations are not personalized at all and can't differentiate between different intents. Session-based recommenders have some capacity to do and also have some notable practical advantages over fully personalized recommenders as well. So, I'd definitely go with predicting items to the session (in practical scenarios, you might want to limit the maximal length of your session to the last X items of the user).
from gru4rec.
thanks for the reply.
from gru4rec.
Related Issues (20)
- hello,i have some questions about the code HOT 2
- About training time HOT 1
- Is it possible to output the embedding of user/session and item vectors? HOT 1
- NOT RNN MODEL HOT 2
- Additional Negative Sampling: Conditional Statement Logic Error HOT 1
- generate_samples function call in gru4rec.py HOT 2
- BPR loss implementation question
- Fit function in gru4rec.py missing data sort HOT 1
- predict_next_batch not considering other products in the same session HOT 2
- No hidden state reset in get_metrics HOT 4
- Where is the data file ?
- theano error HOT 2
- Can you make a brief explaination on how you calculate recall ? HOT 2
- Incremental training (retrain) support removed
- ValueError: Input dimension mis-match. (input[2].shape[0] = 2080, input[3].shape[0] = 32)
- cuda error
- GFF code
- Testing Error:: start = offset_sessions[iters] IndexError: index 2 is out of bounds for axis 0 with size 2
- Evaluating baselines
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gru4rec.