Guest User

Untitled

a guest
Jan 18th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. # Let's try a new loss function: WMRB
  2. print("Training collaborative filter with WMRB loss")
  3. ranking_cf_model = tensorrec.TensorRec(n_components=5,
  4. loss_graph=tensorrec.loss_graphs.WMRBLossGraph())
  5. ranking_cf_model.fit(interactions=sparse_train_ratings_4plus,
  6. user_features=user_indicator_features,
  7. item_features=item_indicator_features,
  8. n_sampled_items=int(n_items * .01))
  9.  
  10. # Check the results of the WMRB MF CF model
  11. print("WMRB matrix factorization collaborative filter:")
  12. predicted_ranks = ranking_cf_model.predict_rank(user_features=user_indicator_features,
  13. item_features=item_indicator_features)
Add Comment
Please, Sign In to add comment