### RecBole Quick Start Output Example Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/install.rst Example output logs from running the RecBole quick start script, showing dataset information, training progress, and evaluation results. ```text 05 Aug 02:16 INFO ml-100k The number of users: 944 Average actions of users: 106.04453870625663 The number of items: 1683 Average actions of items: 59.45303210463734 The number of inters: 100000 The sparsity of the dataset: 93.70575143257098% Remain Fields: ['user_id', 'item_id', 'rating', 'timestamp'] 05 Aug 02:16 INFO [Training]: train_batch_size = [2048] negative sampling: [{'uniform': 1}] 05 Aug 02:16 INFO [Evaluation]: eval_batch_size = [4096] eval_args: [{'split': {'RS': [0.8, 0.1, 0.1]}, 'group_by': 'user', 'order': 'RO', 'mode': 'full'}] 05 Aug 02:16 INFO BPR( (user_embedding): Embedding(944, 64) (item_embedding): Embedding(1683, 64) (loss): BPRLoss() ) Trainable parameters: 168128 Train 0: 100%|████████████████████████| 40/40 [00:00<00:00, 219.54it/s, GPU RAM: 0.01 G/11.91 G] 05 Aug 02:16 INFO epoch 0 training [time: 0.19s, train loss: 27.7228] Evaluate : 100%|██████████████████████| 472/472 [00:00<00:00, 506.11it/s, GPU RAM: 0.01 G/11.91 G] 05 Aug 02:16 INFO epoch 0 evaluating [time: 0.94s, valid_score: 0.020500] 05 Aug 02:16 INFO valid result: recall@10 : 0.0067 mrr@10 : 0.0205 ndcg@10 : 0.0086 hit@10 : 0.0732 precision@10 : 0.0081 ... Train 96: 100%|████████████████████████| 40/40 [00:00<00:00, 230.65it/s, GPU RAM: 0.01 G/11.91 G] 05 Aug 02:19 INFO epoch 96 training [time: 0.18s, train loss: 3.7170] Evaluate : 100%|██████████████████████| 472/472 [00:00<00:00, 800.46it/s, GPU RAM: 0.01 G/11.91 G] 05 Aug 02:19 INFO epoch 96 evaluating [time: 0.60s, valid_score: 0.375200] 05 Aug 02:19 INFO valid result: recall@10 : 0.2162 mrr@10 : 0.3752 ndcg@10 : 0.2284 hit@10 : 0.7508 precision@10 : 0.1602 05 Aug 02:19 INFO Finished training, best eval result in epoch 85 05 Aug 02:19 INFO Loading model structure and parameters from saved/BPR-Aug-05-2021_02-17-51.pth Evaluate : 100%|██████████████████████| 472/472 [00:00<00:00, 832.85it/s, GPU RAM: 0.01 G/11.91 G] 05 Aug 02:19 INFO best valid : {'recall@10': 0.2195, 'mrr@10': 0.3871, 'ndcg@10': 0.2344, 'hit@10': 0.7582, 'precision@10': 0.1627} 05 Aug 02:19 INFO test result: {'recall@10': 0.2523, 'mrr@10': 0.4855, 'ndcg@10': 0.292, 'hit@10': 0.7953, 'precision@10': 0.1962} ``` -------------------------------- ### RecBole Quick Start Example Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/install.rst A Python script demonstrating how to use RecBole's quick start functionality to train and evaluate a BPR model on the ml-100k dataset. ```python from recbole.quick_start import run_recbole run_recbole(model='BPR', dataset='ml-100k') ``` -------------------------------- ### Execute RecBole Quick Start Script Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/install.rst Command to run the Python script created for the RecBole quick start example. ```bash python run.py ``` -------------------------------- ### RecBole YAML Configuration Example Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/context-aware.rst An example YAML configuration file for RecBole, specifying dataset loading columns, model embedding size, and training/evaluation parameters like epochs, batch sizes, and evaluation metrics. ```yaml # dataset config : Context-aware Recommendation load_col: inter: ['user_id', 'item_id', 'rating', 'timestamp'] user: ['user_id', 'age', 'gender', 'occupation'] item: ['item_id', 'release_year', 'class'] threshold: {'rating': 4} # model config embedding_size: 10 # Training and evaluation config epochs: 500 train_batch_size: 4096 eval_batch_size: 4096 eval_args: split: {'RS':[0.8,0.1,0.1]} order: RO group_by: ~ mode: labeled train_neg_sample_args: ~ metrics: ['AUC', 'LogLoss'] valid_metric: AUC ``` -------------------------------- ### RecBole Model Output Example Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/general.rst Example output from running a RecBole model, showing dataset information, training progress, evaluation metrics, and model architecture details. This output helps in understanding the model's performance and resource usage. ```text 24 Aug 01:46 INFO ml-100k The number of users: 944 Average actions of users: 106.04453870625663 The number of items: 1683 Average actions of items: 59.45303210463734 The number of inters: 100000 The sparsity of the dataset: 93.70575143257098% Remain Fields: ['user_id', 'item_id'] 24 Aug 01:46 INFO [Training]: train_batch_size = [4096] negative sampling: [{'uniform': 1}] 24 Aug 01:46 INFO [Evaluation]: eval_batch_size = [4096] eval_args: [{'split': {'RS': [0.8, 0.1, 0.1]}, 'group_by': 'user', 'order': 'RO', 'mode': 'full'}] 24 Aug 01:46 INFO BPR( (user_embedding): Embedding(944, 64) (item_embedding): Embedding(1683, 64) (loss): BPRLoss() ) Trainable parameters: 168128 Train 0: 100%|████████████████████████| 40/40 [00:00<00:00, 200.47it/s, GPU RAM: 0.01 G/11.91 G] 24 Aug 01:46 INFO epoch 0 training [time: 0.21s, train loss: 27.7228] Evaluate : 100%|██████████████████████| 472/472 [00:00<00:00, 518.65it/s, GPU RAM: 0.01 G/11.91 G] 24 Aug 01:46 INFO epoch 0 evaluating [time: 0.92s, valid_score: 0.020500] ...... Train 96: 100%|████████████████████████| 40/40 [00:00<00:00, 229.26it/s, GPU RAM: 0.01 G/11.91 G] 24 Aug 01:47 INFO epoch 96 training [time: 0.18s, train loss: 3.7170] ``` -------------------------------- ### Complete RecBole Workflow Example Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/usage/use_modules.rst Demonstrates the end-to-end process of setting up, training, and evaluating a recommender model using RecBole. It covers configuration initialization, data preparation, model loading, training, and evaluation. ```python from logging import getLogger from recbole.config import Config from recbole.data import create_dataset, data_preparation from recbole.model.general_recommender import BPR from recbole.trainer import Trainer from recbole.utils import init_seed, init_logger if __name__ == '__main__': # configurations initialization config = Config(model='BPR', dataset='ml-100k') # init random seed init_seed(config['seed'], config['reproducibility']) # logger initialization init_logger(config) logger = getLogger() # write config info into log logger.info(config) # dataset creating and filtering dataset = create_dataset(config) logger.info(dataset) # dataset splitting train_data, valid_data, test_data = data_preparation(config, dataset) # model loading and initialization model = BPR(config, train_data.dataset).to(config['device']) logger.info(model) # trainer loading and initialization trainer = Trainer(config, model) # model training best_valid_score, best_valid_result = trainer.fit(train_data, valid_data) # model evaluation test_result = trainer.evaluate(test_data) print(test_result) ``` -------------------------------- ### RecBole Configuration File Example Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/general.rst A sample YAML file (`test.yaml`) demonstrating how to configure dataset loading, model parameters, training, and evaluation settings for RecBole. This file serves as the primary input for model execution. ```yaml # dataset config : General Recommendation USER_ID_FIELD: user_id ITEM_ID_FIELD: item_id load_col: inter: [user_id, item_id] # model config embedding_size: 64 # Training and evaluation config epochs: 500 train_batch_size: 4096 eval_batch_size: 4096 train_neg_sample_args: distribution: uniform sample_num: 1 alpha: 1.0 dynamic: False candidate_num: 0 eval_args: group_by: user order: RO split: {'RS': [0.8,0.1,0.1]} mode: full metrics: ['Recall', 'MRR', 'NDCG', 'Hit', 'Precision'] topk: 10 valid_metric: MRR@10 metric_decimal_place: 4 ``` -------------------------------- ### Run FNN Model with RecBole Quick Start Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/context/fnn.rst This Python snippet demonstrates how to initiate the FNN model using RecBole's quick start functionality. It specifies the model name ('FNN') and the dataset ('ml-100k') to be used for training and evaluation. Requires the RecBole library to be installed. ```python from recbole.quick_start import run_recbole run_recbole(model='FNN', dataset='ml-100k') ``` -------------------------------- ### Run RecBole Pop Model Example Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/general/pop.rst This example demonstrates how to run the RecBole Pop model. It includes a Python script to configure and start the recommendation process, followed by a bash command to execute the script. The Pop model recommends items based on their popularity. ```python from recbole.quick_start import run_recbole run_recbole(model='Pop', dataset='ml-100k') ``` ```bash python run.py ``` -------------------------------- ### Run RecBole on Multi-Node Multi-GPU (Node A) Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/distributed_training.rst This bash command illustrates how to start RecBole training on the first node in a multi-node, multi-GPU setup. It includes parameters for distributed training like IP address, port, number of processes per node, total world size, and group offset. ```bash python run_recbole.py --model=BPR --dataset=ml-100k --config_files=test.yaml --ip='183.174.228.81' --port='5678' --nproc=4 --world_size=8 --group_offset=0 ``` -------------------------------- ### Run RecBole Training and Evaluation Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/usage/run_recbole.rst The `run_recbole` function from `recbole.quick_start` encapsulates the entire process of dataset loading, splitting, model initialization, training, and evaluation. It accepts parameters like `dataset`, `model`, `config_file_list`, and `config_dict` for configuration. ```python from recbole.quick_start import run_recbole run_recbole(dataset=dataset, model=model, config_file_list=config_file_list, config_dict=config_dict) ``` -------------------------------- ### Quick Start: Running AutoInt Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/context/autoint.rst Example Python script to run the AutoInt model with the 'ml-100k' dataset using RecBole's quick start utility. This is followed by the command to execute the script. ```python from recbole.quick_start import run_recbole run_recbole(model='AutoInt', dataset='ml-100k') ``` ```bash python run.py ``` -------------------------------- ### RecBole Configuration Example (YAML) Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/usage/parameter_tuning.rst An example YAML configuration file for RecBole, specifying the dataset and model to be used for hyperparameter tuning. ```yaml dataset: ml-100k model: BPR ``` -------------------------------- ### Run DIN Model with RecBole Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/context/din.rst Example Python script to run the DIN model using RecBole's quick start function. This requires the RecBole library to be installed and a dataset like 'ml-100k' to be available. ```python from recbole.quick_start import run_recbole run_recbole(model='DIN', dataset='ml-100k') ``` -------------------------------- ### Run BPR Model with RecBole Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/general/bpr.rst Example Python script to execute the BPR recommendation model using RecBole's quick start functionality. It specifies the model and dataset to be used. ```python from recbole.quick_start import run_recbole run_recbole(model='BPR', dataset='ml-100k') ``` -------------------------------- ### Install RecBole from Source Source: https://github.com/rucaibox/recbole/blob/master/README_CN.md Installs RecBole directly from its GitHub repository. This involves cloning the repository and then performing an editable installation, which is useful for development or using the latest unreleased features. ```bash git clone https://github.com/RUCAIBox/RecBole.git && cd RecBole pip install -e . --verbose ``` -------------------------------- ### RecBole GRU4Rec Configuration Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/sequential.rst Example YAML configuration file for setting up dataset parameters, model architecture, and training/evaluation settings for the GRU4Rec model in RecBole. This file defines dataset fields, model dimensions, dropout probabilities, and evaluation metrics. ```yaml # dataset config : Sequential Recommendation USER_ID_FIELD: user_id ITEM_ID_FIELD: item_id TIME_FIELD: timestamp load_col: inter: [user_id, item_id,timestamp] ITEM_LIST_LENGTH_FIELD: item_length LIST_SUFFIX: _list MAX_ITEM_LIST_LENGTH: 50 # model config embedding_size: 64 hidden_size: 128 num_layers: 1 dropout_prob: 0.3 loss_type: 'CE' # Training and evaluation config epochs: 500 train_batch_size: 4096 eval_batch_size: 4096 train_neg_sample_args: ~ eval_args: group_by: user order: TO split: {'LS': 'valid_and_test'} mode: full metrics: ['Recall', 'MRR', 'NDCG', 'Hit', 'Precision'] topk: 10 valid_metric: MRR@10 metric_decimal_place: 4 ``` -------------------------------- ### RecBole Configuration Example Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/distributed_training.rst This YAML snippet demonstrates the configuration settings for a RecBole model, including dataset parameters, model embeddings, training batch sizes, negative sampling arguments, evaluation settings, and metrics. ```yaml # dataset config USER_ID_FIELD: user_id ITEM_ID_FIELD: item_id load_col: inter: [user_id, item_id] # model config embedding_size: 64 # Training and evaluation config epochs: 500 train_batch_size: 4096 eval_batch_size: 4096 train_neg_sample_args: distribution: uniform sample_num: 1 alpha: 1.0 dynamic: False candidate_num: 0 eval_args: group_by: user order: RO split: {'RS': [0.8,0.1,0.1]} mode: full metrics: ['Recall', 'MRR', 'NDCG', 'Hit', 'Precision'] topk: 10 valid_metric: MRR@10 metric_decimal_place: 4 ``` -------------------------------- ### Run FEARec Model Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/sequential/fearec.rst Example Python script to run the FEARec model using RecBole's quick start functionality. It specifies the model name and dataset. ```python from recbole.quick_start import run_recbole parameter_dict = { 'train_neg_sample_args': None, } run_recbole(model='FEARec', dataset='ml-100k') ``` -------------------------------- ### Install RecBole from Source Source: https://github.com/rucaibox/recbole/blob/master/README.md Installs RecBole by first cloning the official GitHub repository and then performing a local installation using pip. This method is useful for developers or for accessing the latest unreleased changes. ```bash git clone https://github.com/RUCAIBox/RecBole.git && cd RecBole pip install -e . --verbose ``` -------------------------------- ### Run RecBole Model Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/knowledge/ripplenet.rst Example Python script to run the RippleNet model with the ml-100k dataset using RecBole's quick start functionality. This demonstrates the basic setup for initiating a recommendation task. ```python from recbole.quick_start import run_recbole run_recbole(model='RippleNet', dataset='ml-100k') ``` -------------------------------- ### Run RecBole Model from Source Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/general.rst Command to execute a RecBole model (e.g., BPR) on a specific dataset (e.g., ml-100k) using a predefined configuration file. This initiates the training and evaluation process. ```bash python run_recbole.py --model=BPR --dataset=ml-100k --config_files=test.yaml ``` -------------------------------- ### Run FiGNN Model with RecBole Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/context/fignn.rst This snippet demonstrates how to quickly start using the FiGNN model for CTR prediction with the RecBole framework. It requires the RecBole library to be installed. The example specifies the model name ('FiGNN') and the dataset ('ml-100k'). ```python from recbole.quick_start import run_recbole run_recbole(model='FiGNN', dataset='ml-100k') ``` -------------------------------- ### RecBole HyperTuning Initialization and Run Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/usage/parameter_tuning.rst Demonstrates how to initialize the HyperTuning class from RecBole with specified parameters and run the tuning process. It also shows how to export results and print the best parameters found. ```python from recbole.trainer import HyperTuning from recbole.quick_start import objective_function hp = HyperTuning(objective_function=objective_function, algo='exhaustive', early_stop=10, max_evals=100, params_file='model.hyper', fixed_config_file_list=['example.yaml']) # run hp.run() # export result to the file hp.export_result(output_file='hyper_example.result') # print best parameters print('best params: ', hp.best_params) # print best result print('best result: ') print(hp.params2result[hp.params2str(hp.best_params)]) ``` -------------------------------- ### Run RecBole Model Training Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/context-aware.rst Command to execute RecBole for model training. It specifies the model (e.g., LR), the dataset (e.g., ml-100k), and the path to the configuration file. ```python python run_recbole.py --model=LR --dataset=ml-100k --config_files=test.yaml ``` -------------------------------- ### Initialize HyperTuning Instance Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/usage/parameter_tuning.rst Demonstrates how to create an instance of RecBole's HyperTuning class. It shows the initialization with an objective function, tuning algorithm ('exhaustive'), early stopping criteria, maximum evaluations, a parameter file, and a list of fixed configuration files. ```python from recbole.trainer import HyperTuning from recbole.quick_start import objective_function hp = HyperTuning(objective_function=objective_function, algo='exhaustive', early_stop=10, max_evals=100, params_file='model.hyper', fixed_config_file_list=['example.yaml']) ``` -------------------------------- ### Execute RecBole Python Script Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/sequential.rst Command-line instruction to run the Python script that initiates the RecBole model training and evaluation. ```shell python run.py ``` -------------------------------- ### Train Model Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/usage/use_modules.rst Starts the model training process using the provided training and validation data. Returns the best validation score and results achieved during training. ```python best_valid_score, best_valid_result = trainer.fit(train_data, valid_data) ``` -------------------------------- ### Run RecBole with Parameter Override Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/context-aware.rst Command to execute RecBole, demonstrating how to override configuration parameters like embedding size directly from the command line during execution. ```python python run_recbole.py --model=LR --dataset=ml-100k --config_files=test.yaml --embedding_size=100 ``` -------------------------------- ### Run GRU4Rec Model from Source Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/sequential.rst Command to execute the RecBole framework from source, specifying the GRU4Rec model, the ml-100k dataset, and the custom configuration file. This initiates the training and evaluation process. ```python python run_recbole.py --model=GRU4Rec --dataset=ml-100k --config_files=test.yaml ``` -------------------------------- ### Initialize RecBole Configuration Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/usage/use_modules.rst Shows how to initialize the `Config` object for setting experiment parameters and setup. This module is crucial for defining the model, dataset, and other experimental configurations. ```python config = Config(model='BPR', dataset='ml-100k') ``` -------------------------------- ### Running SASRec with RecBole Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/sequential/sasrec.rst Example Python script to run the SASRec model on the ml-100k dataset using RecBole's quick start functionality. It demonstrates how to set model-specific parameters. ```python from recbole.quick_start import run_recbole parameter_dict = { 'train_neg_sample_args': None, } run_recbole(model='SASRec', dataset='ml-100k', config_dict=parameter_dict) ``` -------------------------------- ### Run RecBole Model via Python API Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/general.rst Python code snippet demonstrating how to use the RecBole API to run a recommendation model. It specifies the model name, dataset, and a list of configuration files to load. ```python from recbole.quick_start import run_recbole run_recbole(model='BPR', dataset='ml-100k', config_file_list=['test.yaml']) ``` -------------------------------- ### Run BERT4Rec with RecBole Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/sequential/bert4rec.rst Example Python script to run the BERT4Rec model using RecBole's quick start functionality. It specifies the model, dataset, and any custom parameter configurations. ```python from recbole.quick_start import run_recbole parameter_dict = { 'train_neg_sample_args': None, } run_recbole(model='BERT4Rec', dataset='ml-100k', config_dict=parameter_dict) ``` -------------------------------- ### Ray Initialization for Tuning Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/usage/parameter_tuning.rst Shows the necessary Python code to initialize the Ray distributed computing framework, which is required before running Ray-based hyperparameter tuning experiments. ```python import ray ray.init() ``` -------------------------------- ### Run PNN Model Quick Start Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/context/pnn.rst Demonstrates how to quickly run the Product-based Neural Network (PNN) model using RecBole's quick start utility. This involves specifying the model name and dataset. ```python from recbole.quick_start import run_recbole run_recbole(model='PNN', dataset='ml-100k') ``` ```bash python run.py ``` -------------------------------- ### RecBole Distributed Training Configuration (Data) Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/distributed_training.rst Example YAML configuration for data settings in RecBole distributed training. Ensures consistency across processes by sharing the same configuration file. ```yaml gpu_id: '0,1,2,3' # dataset config USER_ID_FIELD: user_id ITEM_ID_FIELD: item_id load_col: inter: [user_id, item_id] ``` -------------------------------- ### Run Caser Model with RecBole Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/sequential/caser.rst Demonstrates how to initiate the Caser recommendation model using RecBole's quick start function. It specifies the model name, dataset, and allows for custom parameter configurations. ```python from recbole.quick_start import run_recbole parameter_dict = { 'train_neg_sample_args': None, } run_recbole(model='Caser', dataset='ml-100k', config_dict=parameter_dict) ``` -------------------------------- ### Running DMF with RecBole Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/general/dmf.rst Example Python code to run the DMF model using RecBole's quick start functionality. It specifies the model name ('DMF') and the dataset ('ml-100k'). ```python from recbole.quick_start import run_recbole run_recbole(model='DMF', dataset='ml-100k') ``` -------------------------------- ### Command Line Execution Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/context-aware.rst The command to execute the Python script that initiates the RecBole model training and evaluation process. ```bash python run.py ``` -------------------------------- ### Run NFM Model with RecBole (Python) Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/context/nfm.rst Demonstrates how to quickly start using the NFM model with a specified dataset in RecBole. Requires the RecBole library to be installed and the 'ml-100k' dataset to be available. ```python from recbole.quick_start import run_recbole run_recbole(model='NFM', dataset='ml-100k') ``` -------------------------------- ### RecBole Distributed Training Configuration (Model) Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/distributed_training.rst Example YAML configuration for model parameters in RecBole distributed training. This snippet shows how to set model-specific options like embedding size. ```yaml # model config embedding_size: 64 ``` -------------------------------- ### Run RecBole Model with Python Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/context-aware.rst Executes the RecBole training and evaluation process using the `run_recbole` function. This script takes the model name, dataset name, and a list of configuration files as arguments. ```python from recbole.quick_start import run_recbole run_recbole(model='LR', dataset='ml-100k', config_file_list=['test.yaml']) ``` -------------------------------- ### Run GRU4Rec Model Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/sequential/gru4rec.rst Example Python code to run the GRU4Rec model using RecBole's quick start function. It specifies the model name and dataset, along with a parameter dictionary for configuration. ```python from recbole.quick_start import run_recbole parameter_dict = { 'train_neg_sample_args': None, } run_recbole(model='GRU4Rec', dataset='ml-100k', config_dict=parameter_dict) ``` -------------------------------- ### Run DCNV2 Model with RecBole Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/context/dcnv2.rst Example Python script to run the DCNV2 model on a specified dataset using RecBole's quick start utility. This demonstrates the basic integration for training and evaluation. ```python from recbole.quick_start import run_recbole run_recbole(model='DCNV2', dataset='ml-100k') ``` -------------------------------- ### Run RecBole with NextItNet Model Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/sequential/nextitnet.rst This snippet demonstrates how to initiate the NextItNet model for next item recommendation using RecBole's quick start functionality. It specifies the model name ('NextItNet'), the dataset ('ml-100k'), and allows for custom parameter configurations via a dictionary. ```python from recbole.quick_start import run_recbole parameter_dict = { 'train_neg_sample_args': None, } run_recbole(model='NextItNet', dataset='ml-100k', config_dict=parameter_dict) ``` -------------------------------- ### Running AsymKNN with RecBole Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/general/asymknn.rst Demonstrates how to quickly run the AsymKNN recommendation model using RecBole's quick start utility. It requires importing the `run_recbole` function and specifying the model name and dataset. ```python from recbole.quick_start import run_recbole run_recbole(model='AsymKNN', dataset='ml-100k') ``` -------------------------------- ### Override GRU4Rec Model Parameters Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/sequential.rst Example of how to override specific parameters, such as embedding size, when running a RecBole model from source. This allows for flexible experimentation without modifying the original configuration file. ```python python run_recbole.py --model=GRU4Rec --dataset=ml-100k --config_files=test.yaml --embedding_size=100 ``` -------------------------------- ### RecBole Execution Command Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/general.rst Command-line instruction to execute the Python script that runs the RecBole model. This command initiates the training and evaluation process defined in the script and configuration files. ```bash python run.py ``` -------------------------------- ### RecBole Sequential Data Augmentation Example Source: https://github.com/rucaibox/recbole/blob/master/docs/source/get_started/started/sequential.rst Illustrates how RecBole augments sequential interaction data for models. It shows the transformation of raw user interaction sequences into fixed-length sequences suitable for training. ```python user_id:token item_id_list:token_seq item_id:token 0 0 1 2 3 4 5 ``` ```python user_id:token item_id_list:token_seq item_id:token 0 1 0 0 2 0 1 2 0 3 0 1 2 3 4 0 2 3 4 5 ``` -------------------------------- ### Run EASE Model with RecBole Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/model/general/ease.rst Demonstrates how to execute the EASE recommender system model using RecBole's quick start utility. It specifies the model name ('EASE') and the dataset ('ml-100k') for the recommendation task. ```python from recbole.quick_start import run_recbole run_recbole(model='EASE', dataset='ml-100k') ``` -------------------------------- ### Configure RecBole via Command Line Source: https://github.com/rucaibox/recbole/blob/master/docs/source/user_guide/usage/run_recbole.rst RecBole parameters can be controlled directly from the command line when executing a Python script. This method allows for dynamic parameter adjustments without modifying the script itself. ```bash python run.py --[param_name]=[param_value] ```