You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from scipy.sparse import csr_matrix
# Prediction in batch
batch_size = 1000
start_batch = 0
while start_batch < n_users:
# min() ensures that the batch bounds doesn't go past the end of the index
end_batch = min(start_batch + batch_size, n_users)
prediction_batched = cf_model.predict(
csr_matrix(users_features)[start_batch:end_batch],
items_features)
start_batch = end_batch
If you want to predict a single user towards a single item, you can use the following script.
Hi,
Is there anyone knowing how to run prediction in batch? I got run-out-of-memory problem since my data is way too big (5 million users x 5.000 items).
Thanks in advance.
The text was updated successfully, but these errors were encountered: