Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. import implicit
  2.  
  3. # Use the implicit cython library.
  4. user_vecs, item_vecs = implicit.alternating_least_squares(data_sparse,
  5. factors=20, regularization = 0.1, iterations = 20)
  6.  
  7. # Convert to csr matrix
  8. user_vecs = sparse.csr_matrix(user_vecs)
  9. item_vecs = sparse.csr_matrix(item_vecs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement