Skip to content

How to save train, test data and model preditctions? #762

Answered by chenyushuo
johnny12150 asked this question in Q&A
Discussion options

You must be logged in to vote

For the first question, we suggest that you can use pickle to dump these split data, just like this:

import pickle
with open('split_data.pth', 'wb') as f:
    pickle.dump((train_data, test_data), f)

And we added save funtion for split data in #760 recently. You can use save_split_dataloaders and load_split_dataloaders to save and load split data in the later version.

For the second question, you can see these code (mainly based on #506):

import numpy as np
import torch

from recbole.data.dataloader.general_dataloader import GeneralFullDataLoader
from recbole.data.dataloader.sequential_dataloader import SequentialFullDataLoader


uid_series = np.array([1, 2])

# We assume you have load tes…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@chenyushuo
Comment options

@johnny12150
Comment options

@johnny12150
Comment options

@johnny12150
Comment options

@chenyushuo
Comment options

Answer selected by johnny12150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants