Skip to main content

Classification Metrics

Definitions

Single Label Classification measures the performance of a classification module.


Example Usage

Required data items: predicted_class, ground_truth_class

res = client.metrics.compute(
Metric.SingleLabelClassification,
args={
"predicted_class": "quantitative_question",
"ground_truth_class": "qualitative_question",
},
)
print(res)

Example Output

{
'classification_prediction': 'quantitative_question', 'classification_ground_truth': 'qualitative_question', 'classification_correct': False
}

and the aggregated values

{
'accuracy': 0.8,
'balanced_accuracy': 0.83,
'precision': 0.83,
'recall': 0.83,
'f1': 0.8
}