question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I learn the latent vectors of a new user?

See original GitHub issue

Hello. I have a question regarding your library.

Let’s suppose that I have already trained a hybrid model using a user-item rating matrix for training, and also included some user_features during training.

How can I quickly get the latent features for a new test user (for whom I also have user-features)? And how to provide top-n recommendations for that new user? Would I have to re-train the model? That would be really slow, right? How does this work exactly?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
DoronGicommented, Sep 9, 2018

I found this helpful #210.

Basically in the hybrid model each user is represented by an identity feature, together with all other relevant features for that user. The latent representation is then just the sum of all the feature’s representations. For a new user you don’t have an identity feature, but everything else is exactly the same.

You can create a new user_features sparse matrix of size (1, num_of_features) for the new user, and use it in predict. In that case use user_id=0 when calling the function to indicate that you want to use the first (and only) row in your user_features matrix.

3reactions
DoronGicommented, Sep 11, 2018

I believe that with this library you would have to retrain, or at least continue training (fit_partial) from your previous model (provided that you pre-prepared additional self-features for the new users).

Without additional training all you can do is to generate recommendations based on the user features, or recommend items similar to the items the user has interacted with.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Latent Space in Machine Learning
We can understand patterns or structural similarities between data points by analyzing data in the latent space, be it through manifolds, ...
Read more >
How to Explore the GAN Latent Space When Generating ...
The generative model in the GAN architecture learns to map points in the latent space to generated images.
Read more >
How to get the latent vector as an output from a cnn model ...
You can use get_layer method of the Model class to get a layer by its name, find bellow an example with a dummy...
Read more >
Generating Large Images from Latent Vectors | 大トロ - otoro.net
Current cutting edge techniques of image generation from latent vector are generally based on Generative Adversarial Networks (GAN) or ...
Read more >
Illustration of the latent feature of users and items.
Matrix factorization characterizes data along each dimension by latent vectors and calculates the similarity between users and items in the latent space through ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found