SHARE
TWEET

Untitled

a guest Jan 18th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top