Skip to content

Add new options to Precision and Recall metrics #2571

@sadra-barikbin

Description

@sadra-barikbin

🚀 Feature

I suggest to add new options regarding average parameter of Precision and Recall metrics.
Currently they have two options which are average==False and average==True. I propose to change average options to the following:

  • False: return per class/label metric for multiclass/label input and simple precision for binary input (default option). This is equivalent with average=None of Scikit-learn for multiclass/label input and average=binary for binary input.
  • micro: for multilabel, computes metric using all samples of all labels altogether(equivalent with micro of Scikit-learn). Incompatible with binary and multiclass inputs, as it would be equivalent with Accuracy and user can use that metric.
  • weighted: It computes metric for every class/label then returns weighted average of them using number of samples in each class/label. Recall does not have this option because weighted recall is equivalent with accuracy. Equivalent with weighted of Scikit-Learn.
  • samples: just for multilabel input. It computes metric for every sample then returns their average. Equivalent with samples of Scikit-Learn.

I did not put macro option because user can instantiate metric with average=False then call mean on it to become macro metric.

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