gpt4 book ai didi

sql - 在 SQL 中计算精度/召回率曲线

转载 作者:行者123 更新时间:2023-11-30 09:02:02 26 4
gpt4 key购买 nike

假设我有分类决策和置信度作为记录,有没有办法通过SQL获得精确率/召回率曲线?换句话说,有没有办法将以下一组查询折叠成一个?

select avg(predicted_label=correct_label) from t where confidence<0
select avg(predicted_label=correct_label) from t where confidence<1
select avg(predicted_label=correct_label) from t where confidence<2
select avg(predicted_label=correct_label) from t where confidence<3
select avg(predicted_label=correct_label) from t where confidence<4
select avg(predicted_label=correct_label) from t where confidence<5
select avg(predicted_label=correct_label) from t where confidence<6
....

最佳答案

获取avgpredicted_label对于置信范围,请尝试此操作。
编辑:加入 <=

SELECT FLOOR(t1.confidence), AVG(t2.predicted_label)
FROM Table t1
JOIN Table t2 ON t2.confidence <= t1.Confidence
GROUP BY FLOOR(t1.confidence)

关于sql - 在 SQL 中计算精度/召回率曲线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21318664/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com