GithubHelp home page GithubHelp logo

Comments (3)

maciejkula avatar maciejkula commented on August 19, 2024

LightFM is designed to be able to deal with this problem.

You do this via user features: as long as each user is described by a set of features and these features are shared between the training and the test set, you will be able to make predictions in the test set.

Suppose you describe each user by their unique id and their country of origin. While training, you estimate parameters for the id feature and the country feature. At test time, you can use the country feature to provide prediction even for a user whose id isn't part of the testing set. (You couldn't do this if you didn't have the country feature, because there would be no way of estimating the representation for a new user.)

This is exactly equivalent to the StackExchange example, but instead of using item features (in this case, question tags) you would use user features (by passing them to the fit and predict methods).

from lightfm.

maciejkula avatar maciejkula commented on August 19, 2024

Does my answer help?

from lightfm.

DeoLeung avatar DeoLeung commented on August 19, 2024

Hi @maciejkula ,

May I ask your help about the features, as you mentioned we can use ['user_id', 'country'] as features.
supposed we have 1000 user and 100 country, how to construct the features will be better?

  1. should I normalize them into 1? like user_id == 0.001, country = 0.01
  2. for small feature, like country, expand it to multiple features, like ['country a', 'country b' ...] and mark the related one to 1, similar to the stackoverflow tags.
  3. or is there any instruction on how to weight the features? e.g if I define userid from [0, 1000), country [0, 100), will user_id be over weighted 10 times?

thank you

from lightfm.

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.