lectures-labs icon indicating copy to clipboard operation
lectures-labs copied to clipboard

Clarification on embedding input dimension for Recommender system

Open carlrgb opened this issue 4 years ago • 0 comments

Dear Olivier,

Thank you for the lab tutorial on recommender system, it was really helpful.

While going through and study your lab tutorial on Explicit Feedback Neural Recommender System : https://github.com/m2dsupsdlclass/lectures-labs/blob/master/labs/03_neural_recsys/Explicit_Feedback_Neural_Recommender_System_rendered.ipynb

I would like to check with you whether there is a mistake on the code below :

self.user_embedding = Embedding(output_dim=embedding_size, input_dim=max_user_id + 1, input_length=1, name='user_embedding') self.item_embedding = Embedding(output_dim=embedding_size, input_dim=max_item_id + 1, input_length=1, name='item_embedding')

Should the input_dim be max_user_id (instead of max_user_id+1) since the dataset is only start from 1 to 943 , ie there are total of 943 user in the dataset hence there is no need to + 1 ?

min_user_id = all_ratings['user_id'].min() min_user_id Out[7]: 1

max_user_id = all_ratings['user_id'].max() max_user_id Out[8]: 943

The same applies to the item_embedding as well.

Look forward to your reply.

Thanks

carlrgb avatar Apr 26 '20 12:04 carlrgb