Arize AI
Collaborative Filtering (Recommendation Engine)


This example runs through how to setup a collaborative filtering model in the Arize platform. A collaborative filtering model is normally used in recommendation engines. This example works through a product recommendation based on the user and past ratings of products.
Collaborative Filtering
The above picture represents a typical collaborative filtering scenario. A matrix is built based on activity in this case people and products they rate. The prediction of similar objects is typically based on distance (similarity) metric that can be cosine or euclidean distance.

Common Observability Data for Collaborative Filtering

The common data tracked includes:
  • Timestamp: The date/time of the prediction/recommendation event.
  • Prediction: Recommendation probability or score
  • Person ID: The ID of the person the recommendation is being made "for"
  • Product ID: The ID of the product the probability or score is related to for the person
  • Rank: The ranking of this product ID based on the probability or score in this prediction set
  • Person Vector (optional): The vector of the person matrix for person ID
  • Product Vector (optional): The vector of the product matrix for Product ID
Collaborative Filtering Inputs
The above picture shows how the data is mapped into the Arize platform. The timestamp is the date-time of the recommendation, features include the IDs of the person and product. The embedding vector is optional and can be used for troubleshooting.

Common Performance Metrics

The common metrics for Collaborative Filtering are:
  • LogLoss (for click and not-click)
  • MAE, MAPE, RMSE (for rating prediction)
  • NDCG or Recall @ (please see Arize ranking use case for correct setup)


The Colab example below shows how a Collaborative Filtering model is setup in the Arize platform.
Google Colaboratory