Skip to content

Prediction Graphs

James Kirk edited this page Jul 27, 2018 · 3 revisions

TensorRec allows you to define the algorithm that will be used to compute recommendation scores from a pair of latent representations of your users and items.
You can define a custom prediction function yourself, or you can use a pre-made prediction function that comes with TensorRec in tensorrec.prediction_graphs.

DotProductPredictionGraph

This prediction function calculates the prediction as the dot product between the user and item representations.
Prediction = user_repr * item_repr

CosineSimilarityPredictionGraph

This prediction function calculates the prediction as the cosine between the user and item representations.
Prediction = cos(user_repr, item_repr)

EuclideanSimilarityPredictionGraph

This prediction function calculates the prediction as the negative euclidean distance between the user and item representations.
Prediction = -1 * sqrt(sum((user_repr - item_repr)^2))

Clone this wiki locally