Skip to content

F1 score metric for classification #186

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

Computing the $F_1$ score of a classifier for a specific class is a common task.

Desired solution

  • New method called f1_score in Classifier
  • Required parameter positive_class to specify which value should be treated as positive (all other classes are treated as negative)
  • Call sklearn.metrics.f1_score

Formula:

$$ \frac{2 \mathit{TP}}{2 \mathit{TP} + \mathit{FP} + \mathit{FN}} $$

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Labels

releasedIncluded in a release

Type

No type

Projects

Status

✔️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions