When run, the following bit of code gives me the "Unstacked DataFrame is too big, causing int32 " error. movieID and userID are both uint16 and rating is uint8. How can I go around this?
from scipy.sparse import csr_matrix
# Switch ratings into movie features
df_movie_features = df_ratings.pivot(
index='movieID',
columns='userID',
values='rating'
)
# Converts data of movie features to scipy sparse matrix
mat_movie_features = csr_matrix(df_movie_features.values)