Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于原子数据的问题 #2125

Open
lovedididi opened this issue Dec 5, 2024 · 1 comment
Open

关于原子数据的问题 #2125

lovedididi opened this issue Dec 5, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@lovedididi
Copy link

在运行过程中发现你们给出的原子文件处理有异常值,例如23年的亚马逊sports数据中在item文件中的price有‘-’,导致无法正常运行
报错如下:
Traceback (most recent call last):
File "/home/yy/.conda/envs/recbole/lib/python3.10/site-packages/pandas/io/parsers/base_parser.py", line 848, in _cast_types
values = astype_array(values, cast_type, copy=True)
File "/home/yy/.conda/envs/recbole/lib/python3.10/site-packages/pandas/core/dtypes/astype.py", line 182, in astype_array
values = _astype_nansafe(values, dtype, copy=copy)
File "/home/yy/.conda/envs/recbole/lib/python3.10/site-packages/pandas/core/dtypes/astype.py", line 133, in _astype_nansafe
return arr.astype(dtype, copy=True)
ValueError: could not convert string to float: '—'
当我用代码希望用None替换这个异常数据的时候,会出现另一个错误。
我的代码如下:
df['price'] = df['price'].replace('-', None)

@lovedididi lovedididi added the bug Something isn't working label Dec 5, 2024
@lovedididi
Copy link
Author

这是我上面替换数据后,出现的错误。
Traceback (most recent call last):
File "/home/yy/FDSA/RecBole-master/run_recbole.py", line 49, in
run(
File "/home/yy/FDSA/RecBole-master/recbole/quick_start/quick_start.py", line 52, in run
res = run_recbole(
File "/home/yy/FDSA/RecBole-master/recbole/quick_start/quick_start.py", line 129, in run_recbole
dataset = create_dataset(config)
File "/home/yy/FDSA/RecBole-master/recbole/data/utils.py", line 72, in create_dataset
dataset = dataset_class(config)
File "/home/yy/FDSA/RecBole-master/recbole/data/dataset/sequential_dataset.py", line 36, in init
super().init(config)
File "/home/yy/FDSA/RecBole-master/recbole/data/dataset/dataset.py", line 108, in init
self._from_scratch()
File "/home/yy/FDSA/RecBole-master/recbole/data/dataset/dataset.py", line 118, in _from_scratch
self._load_data(self.dataset_name, self.dataset_path)
File "/home/yy/FDSA/RecBole-master/recbole/data/dataset/dataset.py", line 272, in _load_data
self.item_feat = self._load_user_or_item_feat(
File "/home/yy/FDSA/RecBole-master/recbole/data/dataset/dataset.py", line 340, in _load_user_or_item_feat
feat = self._load_feat(feat_path, source)
File "/home/yy/FDSA/RecBole-master/recbole/data/dataset/dataset.py", line 462, in _load_feat
field, ftype = field_type.split(":")
ValueError: not enough values to unpack (expected 2, got 1)

@Fotiligner Fotiligner self-assigned this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants