Skip to content

issue regarding metrics #14

@kocemir

Description

@kocemir

Hey, I want to ask about the metrics that you used. you are using torch.metrics.functional.classification. but if I switch to sklearn, results differ significantly. Here is the code that I wrote. do you have any guidance regarding the reason?

**acc= accuracy_score(pred_labels.detach().cpu().numpy(),true_labels.detach().cpu().numpy())
f1= f1_score(pred_labels.detach().cpu().numpy(),true_labels.detach().cpu().numpy(),average="macro")
precision= precision_score(pred_labels.detach().cpu().numpy(),true_labels.detach().cpu().numpy(),average="macro")
recall= recall_score(pred_labels.detach().cpu().numpy(),true_labels.cpu().detach().numpy(),average="macro")**

Edit: I understood the reason. Since multiclass_accuracy function of the torchmetrics assumes "average=macro" by default. Why do you choose it, in particular for the accuracy, is it better to use average=macro in this case, or weighted for all of the metrics.

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