recbole.data.utils¶
- recbole.data.utils.create_dataset(config)[source]¶
Create dataset according to
config['model']
andconfig['MODEL_TYPE']
.
- recbole.data.utils.create_samplers(config, dataset, built_datasets)[source]¶
Create sampler for training, validation and testing.
- Parameters
- Returns
train_sampler (AbstractSampler): The sampler for training.
valid_sampler (AbstractSampler): The sampler for validation.
test_sampler (AbstractSampler): The sampler for testing.
- Return type
tuple
- recbole.data.utils.data_preparation(config, dataset, save=False)[source]¶
Split the dataset by
config['eval_args']
and create training, validation and test dataloader.- Parameters
- Returns
train_data (AbstractDataLoader): The dataloader for training.
valid_data (AbstractDataLoader): The dataloader for validation.
test_data (AbstractDataLoader): The dataloader for testing.
- Return type
tuple
- recbole.data.utils.get_dataloader(config, phase)[source]¶
Return a dataloader class according to
config
andphase
.- Parameters
config (Config) – An instance object of Config, used to record parameter information.
phase (str) – The stage of dataloader. It can only take two values: ‘train’ or ‘evaluation’.
- Returns
The dataloader class that meets the requirements in
config
andphase
.- Return type
type