2.2.8. recsys.utils.vec_utils.split_rating_mat

recsys.utils.vec_utils.split_rating_mat(rating_mat, train_size, seed)

Split the rating matrix into two rating matrix with the same shape but difference number of ratings.

Parameters
  • rating_mat (sparse matrix, shape = (n_users_, n_items_)) – Rating matrix.

  • train_size (int) – Number of ratings in the training rating matrix.

  • seed (int) – Random seed for reproducible results across multiple function calls.

Returns

(train_rating_mat, test_rating_mat) – Training and test rating matrix.

Return type

sparse matrix, shape = (n_users_, n_items_)