Created
January 18, 2019 01:58
-
-
Save jfkirk/5e8c6d1c7409a814f31150329ab7c1dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Construct indicator features for users and items | |
user_indicator_features = sparse.identity(n_users) | |
item_indicator_features = sparse.identity(n_items) | |
# Build a matrix factorization collaborative filter model | |
cf_model = tensorrec.TensorRec(n_components=5) | |
# Fit the collaborative filter model | |
print("Training collaborative filter") | |
cf_model.fit(interactions=sparse_train_ratings, | |
user_features=user_indicator_features, | |
item_features=item_indicator_features) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment