RUCAIBox / RecSysDatasets

This is a repository of public data sources for Recommender Systems (RS).
https://recbole.io/
790 stars 126 forks source link

有的数据集只生成两个原子文件,运行时出错 #91

Closed foreseez closed 2 years ago

foreseez commented 3 years ago

convert_inter DIGINETICA can be converted to '*.inter' atomic file

convert_item DIGINETICA can be converted to '*.item' atomic file

如这个数据集只生成两个原子文件 item 和inter 没有user Traceback (most recent call last): File "/opt/anaconda3/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2895, in get_loc return self._engine.get_loc(casted_key) File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'user_id'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "run_recbole.py", line 25, in run_recbole(model=args.model, dataset=args.dataset, config_file_list=config_file_list) File "/Users/zengyujian/RecBole/recbole/quick_start/quick_start.py", line 40, in run_recbole dataset = create_dataset(config) File "/Users/zengyujian/RecBole/recbole/data/utils.py", line 55, in create_dataset return Dataset(config) File "/Users/zengyujian/RecBole/recbole/data/dataset/dataset.py", line 98, in init self._from_scratch() File "/Users/zengyujian/RecBole/recbole/data/dataset/dataset.py", line 109, in _from_scratch self._data_processing() File "/Users/zengyujian/RecBole/recbole/data/dataset/dataset.py", line 151, in _data_processing self._data_filtering() File "/Users/zengyujian/RecBole/recbole/data/dataset/dataset.py", line 173, in _data_filtering self._filter_nan_user_or_item() File "/Users/zengyujian/RecBole/recbole/data/dataset/dataset.py", line 572, in _filter_nan_user_or_item dropped_inter = self.inter_feat.index[self.inter_feat[field].isnull()] File "/opt/anaconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 2902, in getitem indexer = self.columns.get_loc(key) File "/opt/anaconda3/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2897, in get_loc raise KeyError(key) from err image 数据集处理时也没有user part

使用如下的命令就运行出错,是否是因为没有*.user 文件的原因 (base) @B-RGRXML7H-0008 RecBole % python run_recbole.py --model=DeepFM --dataset=diginetica

请问哪些模型需要三个原子文件,哪些模型两个原子文件可以运行呢

EliverQ commented 3 years ago

您好,根据这个数据集的原始格式,确实不会生成.user文件,因为数据集里并没有包含user的信息。 至于您使用的命令,需要在使用的时候设置USER_ID_FIELD这一参数的值,它表示该数据集中对应用户id的列名称,因为并不是所有数据集的用户id列名都叫user_id,所以对于每一个数据集都需要指定一下。

EliverQ commented 3 years ago

以及运行的时候需要什么原子文件,可以在参数中进行设置,一般来说.inter文件是必须的。具体您可以查看我们的API文档: https://recbole.io/docs/user_guide/data/data_args.html

EliverQ commented 3 years ago

另外如果您是刚刚上手使用的话,有一个中文博客是很好的入门指南,也推荐您去看看:https://blog.csdn.net/Turinger_2000/article/details/111182852

foreseez commented 3 years ago

您好,根据这个数据集的原始格式,确实不会生成.user文件,因为数据集里并没有包含user的信息。 至于您使用的命令,需要在使用的时候设置USER_ID_FIELD这一参数的值,它表示该数据集中对应用户id的列名称,因为并不是所有数据集的用户id列名都叫user_id,所以对于每一个数据集都需要指定一下。

请问那么没有.user文件,那么USER_ID_FIELD应该怎么设置?

foreseez commented 3 years ago

以及 image 如果我有这样的自定义数据,怎么弄成运行的数据格式呢?是不是都要分成三类原子文件.user .item .iter
以及如何指定标签列和特征列呢?

hyp1231 commented 3 years ago

如果您的数据没有很明确的、通用的用户特征(.user)和商品特征(.item),只生成一类 .inter 文件即可,具体的形式您参考 benchmark 样例文件即可,简单地说就是文本文件。

我们还是建议您尽量解决网络问题,已有的文档和示例可以帮到您许多。

hyp1231 commented 3 years ago

您好,根据这个数据集的原始格式,确实不会生成.user文件,因为数据集里并没有包含user的信息。 至于您使用的命令,需要在使用的时候设置USER_ID_FIELD这一参数的值,它表示该数据集中对应用户id的列名称,因为并不是所有数据集的用户id列名都叫user_id,所以对于每一个数据集都需要指定一下。

请问那么没有.user文件,那么USER_ID_FIELD应该怎么设置?

如果您的 .inter 交互文件中,有一列数据表示用户 ID,那应将 USER_ID_FIELD 设置为这一列的列名。.user 文件不是必要的。

EliverQ commented 3 years ago

其实这个问题暂时发现起码出现在用sequential 方法例如GRU4Rec跑 Yelp 和 LastFM。从 Google Drive 下载的文件直接用sequential方法去运行会出问题的 keyerror: 'item_id' image

您好,出现这个问题大概率是因为您的配置文件没有设置好。配置文件中的ITEM_ID_FIELD表示此数据集中物品id的列名,需要根据数据集进行调整。建议您看一下数据集的README文件来进行设置

RuihongQiu commented 3 years ago

不好意思我临时删掉了那个评论,我在这里找到了yelp能用的yaml。谢谢您的及时回复。我觉得dataset的yaml是不是也可以多给一点,类似model的properties里面一样。

再次多谢。