RAbraham
RAbraham

Reputation: 6324

LightFM: Weights and Sample Weights

I was looking to gain insight on the weights for the LightFM Implementation for the following:

Sample Weights

Interactions Matrix

Upvotes: 4

Views: 2767

Answers (1)

Maciej Kula
Maciej Kula

Reputation: 889

Sample weights

You can use sample_weights to weigh the importance of any one observation, in the same way you can pass sample_weight to an sklearn classifier.

Weights larger than 1 will lend additional weight to that observation; weights smaller than one will make it less important to the model.

This is accomplished by scaling the learning rate for that observation by its weight.

Interactions

You don't have to create separate models: the two types of interactions can happily be embedded in the same model.

In LightFM models, the data in the interactions matrix is binary. You should use the sample weights to express the confidence you have that a given interaction is positive. This can be percentage watched for movies: however, be aware that if percentage watched is routinely under 1.0, your model will put more weight on the text interactions.

Upvotes: 5

Related Questions