Closed zkid18 closed 4 years ago
Hi, if you use lightfm.data.Dataset
to build your interactions and feature matrices (which you should), then you can use Dataset.mapping to convert back and forth.
For my application, I wrote a wrapper around LightFM to map between internal and external ids but for large datasets you have to consider performance losses caused by lots of back and forth translation.
Hi Simon! Thanks for the comment, I didn't notice Dataset.mapping. Would you mind sharing your wrapper?
Sorry, I cannot do that because there is customer logic in there. @zkid18 I propose to close.
@SimonCW I'll close the PR and later attach my implementation of mapper. Also I'll appreciate if someone would share their mapping as well.
According to the source code the expected inout format for predict function is following:
What is the expected way for mapping external and internal id's on the inference stage? For now I managed to use the private variable
dataset._user_id_mapping
which I don't consider the proper way to solve this case