Giter Club home page Giter Club logo

Comments (2)

hassanmasood1 avatar hassanmasood1 commented on July 23, 2024
batch_size=5
#session_ids = ['0','1','2','3','4']
session_ids = ['0','0','0','0','0']
input_item_ids = valid.ItemId.values[0:batch_size]
predict_for_item_ids = None

print('session_ids: {}'.format(session_ids))
print('input_item_ids: {}'.format(input_item_ids))
print('predict_for_item_ids: {}'.format(predict_for_item_ids))

preds = gru.predict_next_batch(session_ids, input_item_ids, predict_for_item_ids, batch_size)
preds.fillna(0, inplace=True)
print('Preds: {}'.format(preds))

session_ids: ['0', '0', '0', '0', '0']
input_item_ids: ['44790602' '32528001' '32528400' '32528400' '32528010']
predict_for_item_ids: None

Preds: 0 1 2 3 4
04133139 9.912187e-05 2.520136e-04 9.875565e-04 9.875565e-04 1.449896e-04
15994400 1.708450e-05 3.565932e-05 1.420142e-04 1.420142e-04 7.520352e-06
17418001 3.279215e-06 7.654255e-07 1.834371e-06 1.834371e-06 1.035390e-06
15994700 3.367049e-05 1.172445e-04 3.229178e-04 3.229178e-04 3.718351e-05

from gru4rec.

hidasib avatar hidasib commented on July 23, 2024

All items in the same session are considered, but the last item has the most impact on the recommendations (especially on the first few places). But earlier items also have some influence and can change the order (and content) of recommendations. However, if there are sharp changes in the session, the model will probably decide to fully ignore previous items, either because this is also supported by the data (e.g. sharp changes is sessions are usually permanent) or because this type of change in focus has never (or rarely) happened in the data and thus during inference time this is the best approach.

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.