Skip to content

Metrics evaluator

fyt.core.metrics_evaluator

Metrics evaluation for trained models.

Extracted from Trainer to follow the Single Responsibility Principle.

MetricsEvaluator

Computes evaluation metrics for a trained model.

Parameters:

Name Type Description Default
metrics list[MetricType | str]

List of metrics to compute.

required
metric_averaging str

Averaging strategy for precision/recall/f1. "auto" resolves to "binary" for two-class data and "weighted" otherwise.

'auto'

compute(model, data_split, random_state)

Compute evaluation metrics on the test set.

Parameters:

Name Type Description Default
model Any

Trained model with predict() and optionally predict_proba().

required
data_split DataSplit

Data split containing test data.

required
random_state int

Random state seed used for this evaluation.

required

Returns:

Type Description
MetricResults

MetricResults containing all computed metrics.