Recommendation Engine algorithms The basic principle of a recommendation engine is filters the data using past user behaviour and product/item characteristics or capturing the interaction between both, using suitable algorithm and recommends the most relevant items to users. There are many approaches and hence many algorithms according to the specific business need and strategy. With out going into much detail, following are a few options although not exhaustive in the order of complexity(from most primitive to most advanced).
a) Popularity Based: Non-personalized and recommend most popular products to every user. A good solution during cold-start stage(when there is sufficient data available)
b) Content Based: Classifier for the user’s likes and dislikes based on content’s feature.
c) Collaborative filtering:
i)User-User collaborative filtering: Based on similarity score between user pairs using suitable distance metric(cosine similarity, Euclidean Distance, Pearson’s Correlation etc) picks up the most similar users and recommends products which these similar users have liked or bought previously.
ii) Item- Item collaborative filtering: Here similarity scores between each pair of items are calculated. Using this score matrix based on preference of specific user/user group in the past, similar products are recommended.
d) Matrix Factorization(MF): MF is the 1st generation of of machine learning/ model based approach. The basic idea is to find the user and item embeddings(latent factor representation) by decomposing user-item matrix(past user-item interaction).Although the detailed discussion is beyond scope of this article matrix decomposition is a way of reducing a giant matrix into its constituent parts based on linear algebraic technique. It is an approach that can simplify more complex matrix operations that can be performed on the decomposed matrix rather than on the original matrix itself and has similarity to the techniques like PCA, SVD etc.
Matrix Factorization In recommendation system context the decomposition happens from massive user-item matrix(sometimes called rating matrix) to individual user and item matrix. Let us assume that we have to find k latent features/factors with rating matrix R(MxN), user matrix U and item matrix I then the decomposition happens according to following fashion:
R=U∑I , where:
· N is the total number of movies
· K is the total latent features/factors
· R is MxN user-movie rating matrix, where M and N is total number of users and items resp.
· U is Mxk user embedding matrix
· I is Nxk item embedding matrix
· Σ is kxk diagonal matrix which represents the essential weights of latent features
This decomposition task can be achieved using different ML algorithms such as ALS(alternating least squares), BPR(Bayesian Personalized Ranking), LMF(LogisticMatrixFactorization) etc.
e) Other embedding methods: ML based embedding techniques like node2vec, prod2vec etc
f) Deep learning and reinforcement learning(RL) technique: These techniques are new and still in the experimentation phase, such as deep neural network based recommendation,Autoencoder, Markov decision process (MDP) etc.
The full business case and article link is as follows: