Metrics

class stambo.metrics.Metric(metric, int_input=False)[source]

Bases: object

A wrapper for metrics that take predictions and ground truth labels as two arguments.

__call__(sample)[source]

The call method. This runs the metric on the supplied data. If the metric is meanto to be run on integer input. it wil use the argmaxed predictions that are stored by the PredSampleWrapper object.

Parameters:

sample (PredSampleWrapper) – Data on which the metric is computed.

Returns:

Metric value for the provided sample.

Return type:

float

class stambo.metrics.ROCAUC[source]

Bases: Metric

The ROC-AUC metric. Defined for Binary classifiers.

class stambo.metrics.AP[source]

Bases: Metric

The Average Precision metric. Defined for Binary classifiers.

class stambo.metrics.F1Score[source]

Bases: Metric

The F1 score metric. Defined for Binary classifiers.

class stambo.metrics.QKappa[source]

Bases: Metric

Cohen’s kappa score (quadratic).

class stambo.metrics.BACC[source]

Bases: Metric

The balanced accuracy score.

class stambo.metrics.MCC[source]

Bases: Metric

The Matthew’s correlation coefficient

class stambo.metrics.MSE[source]

Bases: Metric

The Mean squared error

class stambo.metrics.MAE[source]

Bases: Metric

The mean absolute error.