Giter Club home page Giter Club logo

Comments (2)

hidasib avatar hidasib commented on July 3, 2024

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.

mokarakaya avatar mokarakaya commented on July 3, 2024

thanks for the reply.

from gru4rec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.