Recommendation System

Original article was published on Artificial Intelligence on Medium

Recommendation Engine Using Machine Learning

The Recommendation System is gaining popularity is this era of Machine Learning and Artificial Intelligence where everyone wants to customize their product/sales for their customers. So here is the basic intuition about what is the recommendation system.

The basic recommendation could be as simple as the correlation coefficient matrix between the employee_id and the item_id. It provides the correlation of an item with employees based on their previous order history. This does not provide any recommendation but helps to build a basic intuition about the recommendation system.

An overview of the recommendation system using the LightFm. The initial stage recommendation system can be built using the LightFM recommendation System. The pure collaborating filtering recommendation system can also be built which uses the item and employee interaction as its input. The interaction matrix was built based on these features which were then followed by several operations of zero mean centering, filling of NAN values with zero, and finally into a CSR Spare Matrix.

The LightFm Recommendation System include many Hyper Parameter which can be tuned accordingly for the better result. The built recommendation system was able to give recommendations both user_item and item_item recommendation.

The Salient Features of these recommendations are as follows:-

User_Item Recommendation — The employee_id of a user is provided as input and it then gave the n recommendation item as its output. The n recommendation does not include the Known Likes i.e the item that the user has already visited once, this can be further modified according to our needs. This model will be trained on the basis of employee_item interaction Matrix. This feature works by predicting the score of each item for the given employee_id and then sorting the predicted score in descending followed by recommending the top n items in the list.

Item_Item Recommendations — The item_id of an item is provided as input and it then provides an output of all similar type items as a recommendation. This feature work by embedding the items into an n-component vector which then can be used to gave the similarity between items using the Cosine Similarity. The item-item matrix is made using the same cosine similarity on individual item vectors. The item are then sorted on similarity scores for a given item_id and the top n item in the sorted list are recommended.

The LightFm also provides ways for considering the user_features and item_features for the recommendation. But it has a constraint of using the same number of user and item features according to my understanding of it as of now. The dot product between user and item features demands for the same number of features. The user_item recommendation matrix is obtained as a dot product and this is then optimized using gradient descent and different loss functions.

The Cross-Validation of the recommendation system is as important as building the recommendation system itself. The initial validation at the developer end can be done by dividing the existing data into the test train. The recommendation system on train data can be used to cross-check whether or not the recommended item is present in employee actual orders in the test set. The different parameters for validation can be set and this can be further used to distinguish between the feasibility of the different algorithms.