A/B Analysis for a Recommendation Model
Estimated completion time: 14 min.
Overview
Prerequisites
Set Up an A/B Application
Prepare a model for uploading
lightfm==1.15
numpy~=1.18
joblib~=0.15import sys
import joblib
from lightfm import LightFM
from lightfm.datasets import fetch_movielens
if __name__ == "__main__":
no_components = int(sys.argv[1])
print(f"Number of components is set to {no_components}")
# Load the MovieLens 100k dataset. Only five
# star ratings are treated as positive.
data = fetch_movielens(min_rating=5.0)
# Instantiate and train the model
model = LightFM(no_components=no_components, loss='warp')
model.fit(data['train'], epochs=30, num_threads=2)
# Save the model
joblib.dump(model, "model.joblib")Upload Model A
Upload Model B
Create an Application
Invoking movie-ab-app
movie-ab-appAnalyze production data
Read Data from parquet
Compare production data with new labeled data
Latencies

Mean Top-3 Hit Rate
Last updated
Was this helpful?