0

I am getting the following error

numpy.core._exceptions.MemoryError: Unable to allocate array with shape (1329, 22474) and data type float64

This is my code:

interactions_df = pd.DataFrame(list(DB[USER_COLLECTION].find({})))
interactions_full_df = interactions_df.groupby(['personId', 'contentId'])[
    'eventStrength'].sum().apply(smooth_user_preference).reset_index()
users_items_pivot_matrix_df = interactions_full_df.pivot(index='personId',  # edited: interactions_train_df
                                                         columns='contentId',
                                                         values='eventStrength').fillna(0)
users_items_pivot_matrix = users_items_pivot_matrix_df.as_matrix()
users_ids = list(users_items_pivot_matrix_df.index)

In USER_COLLECTION, I have 30009 documents, and 4 columns: _id, personId(string), eventStrength(double), contentId(int32), I tried to settings to increase ram but it didn't work, still couldn't figure it out.

update: After setting custom virtual memory on windows by maximum memory 80000 MB and initial size 5500 MB, and reboot the system, it still have memory error.

shanlee
  • 1
  • 1

0 Answers0