Giter Site home page Giter Site logo

Implement WMRB about tensorrec HOT 6 CLOSED

jfkirk avatar jfkirk commented on May 24, 2024 5
Implement WMRB

from tensorrec.

Comments (6)

mkoryak avatar mkoryak commented on May 24, 2024 1

You should do it, I want to use this, but I can't read that math shit

from tensorrec.

jfkirk avatar jfkirk commented on May 24, 2024 1

I added WMRB loss: 2efc01e

I experimented with-and-without the final logarithm step and got much better results without the logarithm, so I left it commented out.

from tensorrec import TensorRec
from tensorrec.eval import fit_and_eval
from tensorrec.loss_graphs import separation_loss, wmrb_loss
from test.datasets import get_movielens_100k

train_interactions, test_interactions, user_features, item_features = get_movielens_100k()

model_baseline = TensorRec()
print(fit_and_eval(model_baseline, user_features, item_features, train_interactions, test_interactions, {'epochs': 1000}))

model_separation = TensorRec(loss_graph=separation_loss)
print(fit_and_eval(model_separation, user_features, item_features, train_interactions, test_interactions, {'epochs': 1000}))

model_wmrb = TensorRec(loss_graph=wmrb_loss)
print(fit_and_eval(model_wmrb, user_features, item_features, train_interactions, test_interactions, {'epochs': 1000}))

yields

(0.19826102103939364, 0.011927194860813705) # RMSE
(0.21846470208354574, 0.012805139186295503) # Separation
(0.23483778593521634, 0.013693790149892934) # WMRB

These quick-and-dirty results (recall at 100, precision at 100) look good on movielens 100k

from tensorrec.

saulvargas avatar saulvargas commented on May 24, 2024

Hi!

In addition to removing the |Y|/|Z| term in Eq. 4 in the paper, the other trick I did was disregarding the I(y' \in \hat{y}) term in the same formula as, in practice, it rarely takes the value of 0 (for sparse datasets with large number of items, naturally). That should make the implementation a piece of cake. I also observed that a value of |Z| = 10 gives quite good performances, although that may arguably depend on the dataset.

Hope it helps.

Cheers,
SaΓΊl

from tensorrec.

umang-singhal avatar umang-singhal commented on May 24, 2024

Any updates on this?

from tensorrec.

jfkirk avatar jfkirk commented on May 24, 2024

Hey @Umang-01 - diving in to this today, will update with in the week.

from tensorrec.

umang-singhal avatar umang-singhal commented on May 24, 2024

@jfkirk Thanks a ton for the quick help. πŸ‘

from tensorrec.

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.