Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Let's try a new loss function: WMRB
- print("Training collaborative filter with WMRB loss")
- ranking_cf_model = tensorrec.TensorRec(n_components=5,
- loss_graph=tensorrec.loss_graphs.WMRBLossGraph())
- ranking_cf_model.fit(interactions=sparse_train_ratings_4plus,
- user_features=user_indicator_features,
- item_features=item_indicator_features,
- n_sampled_items=int(n_items * .01))
- # Check the results of the WMRB MF CF model
- print("WMRB matrix factorization collaborative filter:")
- predicted_ranks = ranking_cf_model.predict_rank(user_features=user_indicator_features,
- item_features=item_indicator_features)
Add Comment
Please, Sign In to add comment