RUCAIBox / RecBole-CDR

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

Converting DataLoader object into pandas dataframe #46

Closed ajaykv1 closed 1 year ago

ajaykv1 commented 1 year ago

Hi, in the quick_start file, I can see this line:

train_data, valid_data, test_data = data_preparation(config, dataset)

test_data is stored as a object. I am assuming that test_data has the user_id, item_id, and rating for the target domain. How can I read this object as a pandas dataframe** to perform my own evaluation?

Wicknight commented 1 year ago

Hello @ajaykv1 , I don't recommend that you convert DataLoader object here. You can get the rating data of the test dataset with the following code:

dataset = create_dataset(config)
train_dataset, valid_dataset, test_dataset = dataset.build()
test_rating_data = test_dataset.inter_feat

The test_rating_data here is an object that belongs to the Interaction class. You can then try to convert it to DataFrame.