lyst / lightfm

A Python implementation of LightFM, a hybrid recommendation algorithm.
Apache License 2.0
4.77k stars 691 forks source link

Model input: CSR vs COO sparse matrices ? (Different results) #555

Open jimzer opened 4 years ago

jimzer commented 4 years ago

I noticed a strange issue using the library with the sparse matrices format.

If I use the same interaction matrix but as CSR while training, I get different results when evaluating compared to using a COO matrix for interactions. Is it a normal behavior ?

Also how can I be certain of the format I should use for all LighFM input: lightfm.Dataset returns all COO matrices when building interactions and features, but in the source it's said that user_features and item_features should be as CSR.

Thanks for you help !

hcygeorge commented 4 years ago

I tried both csr and coo matrix on train/test data, and I got nearly the same result(mAP) of model. But I'm curious about which data format is better for training lightFM model, too.