https://tracholar.github.io/machine-learning/2018/01/26/auc.html

select
    (ry - 0.5*n1*(n1+1))/n0/n1 as auc
from(
    select
        sum(if(y=0, 1, 0)) as n0, --50
        sum(if(y=1, 1, 0)) as n1,--100
        sum(if(y=1, r, 0)) as ry --100
    from(
        select y, row_number() over(order by score asc) as r
        from(
            select y, score
            from some.table
        )A
    )B
)C

相关文章:

  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-12-09
  • 2021-07-10
猜你喜欢
  • 2021-08-14
  • 2021-12-14
  • 2022-12-23
  • 2021-12-05
  • 2021-12-02
  • 2022-12-23
相关资源
相似解决方案