Skip to content
EvalSuite
Documentation menu

Classification

Accuracy

Implementedclassification.accuracy

Definition

Fraction of observations whose predicted label equals the true label.

Formula

Accuracy = (TP + TN) / (TP + TN + FP + FN)

Range: [0, 1]

Inputs and outputs

  • y_true: array of class labels
  • y_pred: array of predicted labels

Returns: float

Assumptions

No assumptions beyond valid, aligned inputs of the documented types.

Limitations

  • Misleading under class imbalance: a constant majority-class predictor can score highly.

Python API

PythonSince v0.1.0
import evalsuite as es

es.accuracy(y_true, y_pred)

References

Primary references for this entry have not been added yet.

Implementation status