RUCAIBox / RecBole-CDR

This is a library built upon RecBole for cross-domain recommendation algorithms
MIT License
91 stars 13 forks source link

Custom Datasets for Cross Domain Recommendation #35

Closed ajaykv1 closed 2 years ago

ajaykv1 commented 2 years ago

Hi, I'd like to use 2 custom datasets for the source and target domain. I understand that RecBole-CDR builds off of the existing RecBole library, and I was able to use a custom dataset in RecBole to run general recommendation algorithms.

How can I use custom datasets with RecBole-cdr? (specifically specifying the source and target domain, and choosing the model I want to run).

Wicknight commented 2 years ago

@ajaykv1 Hello, thanks for your attention to RecBole-CDR ! Similar to RecBole, you can set your customized dataset configuration through a 'yaml file' or 'parameter dictionary' in RecBole-CDR. The following is an example of setting by using the parameter dictionary:

from recbole_cdr.quick_start import run_recbole_cdr

parameter_dict={
       # dataset info
       'source_domain': {
              'dataset': 'ml-1m',
              'data_path': 'dataset/'},
       'target_domain': {
              'dataset': 'ml-100k',
              'data_path': 'dataset/target/',
              'user_inter_num_interval': '[5,inf)'},
       # other settings
       'train_epochs': ['SOURCE:300','TARGET:300','OVERLAP:300']
       }

run_recbole_cdr(model='EMCDR', config_dict=parameter_dict)

The dataset of each domain('source_domain' and 'target_domain' above) is the same as the dataset in RecBole, which can follow the configuration you use in RecBole.