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

[🐛BUG] LightGCN无法使用设置rating阈值的方式来生成负采样,KeyError: 'neg_item_id' #2026

Open
zzzZHANGYIXUAN opened this issue Mar 29, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@zzzZHANGYIXUAN
Copy link

我使用如下的yaml参数文件,最终报错:KeyError: 'neg_item_id'
而我将train_neg_sample_args: ~注释掉后,代码可以运行,但是结果非常差,LightGCN在douban-book上的RMSE超过了1.0

dataset config

field_separator: "\t"
seq_separator: " "
load_col:
inter: [user_id, item_id, rating]
net: [source_id,target_id:token]
USER_ID_FIELD: user_id
ITEM_ID_FIELD: item_id
RATING_FIELD: rating
NEG_PREFIX: neg_
LABEL_FIELD: label
threshold:
rating: 4
train_neg_sample_args: ~

training and evaluation

epochs: 500
train_batch_size: 4096
eval_args:
split: {'RS':[0.8, 0.1, 0.1]}
group_by: ~
mode: labeled
order: RO
valid_metric: RMSE
metrics: ['AUC', 'LogLoss','MAE','RMSE']

@zzzZHANGYIXUAN zzzZHANGYIXUAN added the bug Something isn't working label Mar 29, 2024
@zzzZHANGYIXUAN
Copy link
Author

补充一下,RMSE非常的差的原因是没有通过threshold: rating: 4来生成负样本,而注释掉train_neg_sample_args: ~后,模型会使用以下隐式反馈来生成负样本。
train_neg_sample_args:
uniform: 1

@97z
Copy link

97z commented Apr 19, 2024

train_neg_sample_args应该是需要设置负采样参数的

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

3 participants