ICSRec icon indicating copy to clipboard operation
ICSRec copied to clipboard

指标计算

Open wcnm231 opened this issue 1 year ago • 5 comments

您好,我在看代码的时候遇到了一个问题,在计算各个指标精度的时候,得出的预测列表pred_list应该是得分排名前n的项目对应的索引,索引时从0开始的 ,而项目的id是从1开始的,answer对应的也是项目id,预测列表中对应的是项目索引,这样计算是不是有问题呢,还是说我理解的有问题,期待您的回复,非常感谢

wcnm231 avatar Oct 04 '24 12:10 wcnm231

你好,这样处理是没有问题的,可以参考baseline文章(DuoRec,MCLRec,ICLRec等),我们计算指标的方式是一样的;另外你提到的项目id从1开始是因为这里id为0的商品可以看作是冷启动的一个item,所以id数量实际为(id总数+1),多的这个1就是id为0的embedding,这里我们是参考了上面提到的baseline的文章和代码。索引从0开始是没有问题的,因为可能会推荐id为0的(实际可能存在)的item。

---原始邮件--- 发件人: @.> 发送时间: 2024年10月4日(周五) 晚上8:41 收件人: @.>; 抄送: @.***>; 主题: [QinHsiu/ICSRec] 指标计算 (Issue #5)

您好,我在看代码的时候遇到了一个问题,在计算各个指标精度的时候,得出的预测列表pred_list应该是得分排名前n的项目对应的索引,索引时从0开始的 ,而项目的id是从1开始的,answer对应的也是项目id,预测列表中对应的是项目索引,这样计算是不是有问题呢,还是说我理解的有问题,期待您的回复,非常感谢

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

QinHsiu avatar Oct 04 '24 15:10 QinHsiu

感谢你的回复,所以您的意思是指项目id实际上也是从0开始的和索引是一一对应的,模型输出的预测列表前20个项目的索引,实际上就是项目的id

wcnm231 avatar Oct 05 '24 03:10 wcnm231

你好,是的

---原始邮件--- 发件人: @.> 发送时间: 2024年10月5日(周六) 中午11:12 收件人: @.>; 抄送: @.@.>; 主题: Re: [QinHsiu/ICSRec] 指标计算 (Issue #5)

感谢你的回复,所以您的意思是指项目id实际上也是从0开始的和索引是一一对应的,模型输出的预测列表前20个项目的索引,实际上就是项目的id

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

QinHsiu avatar Oct 05 '24 03:10 QinHsiu

非常感谢您的回复,这解决了我挺久的困惑

wcnm231 avatar Oct 05 '24 03:10 wcnm231

不客气,有问题欢迎交流。有时候比较忙,所以不能及时回复,只要看到了就一定会回复。

---原始邮件--- 发件人: @.> 发送时间: 2024年10月5日(周六) 中午11:17 收件人: @.>; 抄送: @.@.>; 主题: Re: [QinHsiu/ICSRec] 指标计算 (Issue #5)

非常感谢您的回复,这解决了我挺久的困惑

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

QinHsiu avatar Oct 05 '24 03:10 QinHsiu

您好,在datasets.py文件代码中 for t_ in temp: if t_[1:]==items[:-3]: continue else: target_pos_=t_[1:] flag=True if not flag: target_pos_=random.choice(temp)[1:]这段代码我的理解找到一个除本身之外的,其他具有相同目标项的用户序列作为当前用户正样本用于粗粒度对齐,这里代码应该是表示只要找到一个就停止循环吗,但是代码中并没有体现出来找到一个就停止循环,是不是在 flag=True后面少了一行break跳出循环呢

wcnm231 avatar Oct 21 '24 09:10 wcnm231

你好,感谢你提出的建议,这里是可以在flag等于true的时候break的,找到一个就可以退出循环。

---原始邮件--- 发件人: @.> 发送时间: 2024年10月21日(周一) 下午5:55 收件人: @.>; 抄送: @.>;"State @.>; 主题: Re: [QinHsiu/ICSRec] 指标计算 (Issue #5)

您好,在datasets.py文件代码中 for t_ in temp: if t_[1:]==items[:-3]: continue else: target_pos_=t_[1:] flag=True if not flag: target_pos_=random.choice(temp)[1:]这段代码我的理解找到一个除本身之外的,其他具有相同目标项的用户序列作为当前用户正样本用于粗粒度对齐,这里代码应该是表示只要找到一个就停止循环吗,但是代码中并没有体现出来找到一个就停止循环,是不是在 flag=True后面少了一行break跳出循环呢

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

QinHsiu avatar Oct 22 '24 00:10 QinHsiu