We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe we can just pickle the model itself after it's been trained?
The text was updated successfully, but these errors were encountered:
user_ids = [0, 0, 1, 1, 2] movie_ids = [0, 1, 1, 2, 2] ratings = [5, 4, 5, 4, 5] # Only 4s and 5s for this example
interaction_matrix = coo_matrix((ratings, (user_ids, movie_ids)), shape=(3, 3))
model = LightFM(loss='warp')
model.fit(interaction_matrix, epochs=30, num_threads=2)
scores = model.predict(0, np.arange(3)) top_items = np.argsort(-scores) print("Top recommended items for User 0:", top_items)
from lightfm.evaluation import precision_at_k, auc_score precision = precision_at_k(model, interaction_matrix, k=5).mean() auc = auc_score(model, interaction_matrix).mean()
print(f"Precision at k=5: {precision}, AUC Score: {auc}") something like this?
Sorry, something went wrong.
I think the pickleing would happen after your model.fit code.
pickle
model.fit
There's also a question of how long it takes to fit the model. If it's under 10 seconds, it might not be worth it to deal with pickle.
No branches or pull requests
Maybe we can just pickle the model itself after it's been trained?
The text was updated successfully, but these errors were encountered: