Compare classifiers
Overview
Puts two to five classifiers side by side on the same dataset and names the best one.
You pick the evaluations from one list, so comparing three or four models takes one node instead of a chain. The winner is chosen by the same model ranking that Get best model uses, so both nodes always agree on which model is best. The winning model, its evaluation and its report come out as outputs, so the flow can carry on with it.
Prerequisites
How it works
FAQ
Which metric decides the winner?
The one you pick in Metric: accuracy (the default), weighted F1 or macro F1. Set it to the same value as the classification Metric of Get best model, and both nodes pick the same model. Weighted F1 follows class sizes, while macro F1 gives every class the same weight, so it’s the better choice when rare classes matter to you.
What happens when two models have the same score?
The older model wins. The run log says which models tied, on what value, and which one was kept.
Why can the report numbers differ from the evaluation numbers?
The winner comes from the scores each evaluation recorded. The report recomputes every score on the images all models share, so if one evaluation covered extra images, its report numbers can be a little different.
Why does the run fail with no common images?
The evaluations don’t share a single image. Check that they were all made on the same dataset.
Why is an evaluation rejected?
The node needs the per-image results from an Evaluate classifier report. An evaluation that has no report, or whose report came from another node, can’t be compared.
Inputs
Test or validation dataset the classifiers were evaluated on. Key: GT_DATASET.
Two to five evaluations of this dataset to compare, in any order. Values come from GT_DATASET. Key: EVALUATIONS.
Evaluation metric that picks the winner. Bind it to the classification Metric of Get best model so both pick by the same rule. Key: RANKING_METRIC.
Options:
- Accuracy (
accuracy_top1) - Weighted F1 (
f1_weighted) - Macro F1 (
f1_macro)
Outputs
Asset ID containing the comparison report. Shown as an artifact. Key: REPORT_ID.
Registry reference of the winning model (highest on Metric). Shown as an artifact. Key: BEST_MODEL_ID.
Framework of the winning model, such as yolo, to branch on in a Router. Key: WINNER_FRAMEWORK.
Evaluation report asset ID of the winning model (can be passed to another Compare node). Key: BEST_REPORT_ID.
Evaluation of the winning model, ready to wire into another comparison. Key: BEST_EVALUATION_ID.
Name of the winning model and its score on Metric. Shown on the node as a badge. Key: WINNER.
Models and configuration
Metric is the only setting. The evaluation settings themselves come from the Evaluate classifier runs you select.
Report
The comparison report opens in the preview widget:
- Overview: the winner and its score on Metric, then a table of accuracy, macro F1 and weighted F1 for every model.
- Per-class comparison: F1, precision and recall for each class, all models on one scale.
- Change against the first model: per-class F1 difference of every other model against the first one you picked.
- Confusion matrices: one per model, on the same class order.
- Per-image results: every image with each model’s prediction, confidence and how many models got it right.
Runtime
Runs on an ordinary worker. It reads a few reports and writes one, so it finishes quickly even on large datasets.
JSON config
Machine-readable node interface for automation and advanced usage.