Skip to content
New issue

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

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

Already on GitHub? # to your account

invalid batch #353

Open
scalaboy opened this issue Jan 10, 2021 · 0 comments
Open

invalid batch #353

scalaboy opened this issue Jan 10, 2021 · 0 comments

Comments

@scalaboy
Copy link

请问下,这个invalid batch 是怎么个逻辑计算的?代码没看明白、

    raw_arr = np.column_stack((preds, labels))
    raw_arr = sorted(raw_arr, key=lambda d: d[0])

    auc = 0.
    fp1, tp1, fp2, tp2 = 0., 0., 0., 0.
    for record in raw_arr:
        fp2 += 1 - record[1]
        tp2 += record[1]
        auc += (fp2 - fp1) * (tp2 + tp1)
        fp1, tp1 = fp2, tp2

    threshold = len(preds) - 1e-3
    if tp2 > threshold or fp2 > threshold:
        print('%s invalid batch' % self.name)
        return
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant