Skip to content

question of calculate_acc #24

@amazingmozi

Description

@amazingmozi

def calculate_acc(y_true, y_pred, thres):
r_acc = accuracy_score(y_true[y_true==0], (y_pred[y_true==0] > thres).astype(int))
f_acc = accuracy_score(y_true[y_true==1], (y_pred[y_true==1] > thres).astype(int))
acc = accuracy_score(y_true, y_pred > thres)
return r_acc, f_acc, acc
In the context of testing a model, within a script such as validate.py, the function calculate_acc why not calculate r_acc using the statement r_acc = accuracy_score(y_true[y_true==0], (y_pred[y_true==0] <= thres)) ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions