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
I have a trained model saved as a pickle file. My model has both user and item features.
When I load the model, I can make predictions for seen users by calling pickled_model.predict(user_ids = [0], item_ids =[0])
But, I want to adjust it to a cold start problem, making predictions for new users. In this case, it requires to have dataset.fit_partial() , where the dataset should be fitted in the old dataset. It there a way to save and retrieve the dataset? Or we need to refit it every time before calling fit_partial()
The text was updated successfully, but these errors were encountered:
Did you try saving the dataset as pickle? I think it should work:
import pickle
pkl_ext = '.pkl'
dataset_filename = 'lightfm_dataset_abc' + pkl_ext
# Save the dataset to the file using pickle
with open(dataset_filename, 'wb') as dataset_file:
pickle.dump(dataset, dataset_file)
And when you want to load dataset:
# Load the dataset from the specified file path using pickle
with open(dataset_filename, 'rb') as dataset_file:
dataset = pickle.load(dataset_file)
# Fit more data to the loaded dataset
# For example, you can add more user-item interactions:
# dataset.fit_partial(users=new_user_ids, items=new_item_ids)
I have a trained model saved as a pickle file. My model has both user and item features.
When I load the model, I can make predictions for seen users by calling
pickled_model.predict(user_ids = [0], item_ids =[0])
But, I want to adjust it to a cold start problem, making predictions for new users. In this case, it requires to have
dataset.fit_partial()
, where thedataset
should be fitted in the old dataset. It there a way to save and retrieve the dataset? Or we need to refit it every time before callingfit_partial()
The text was updated successfully, but these errors were encountered: