Skip to content

test: validate precision, recall and F1 against scikit-learn (SKEEP-009 phases 1 and 2) - #1562

Merged
michalharakal merged 2 commits into
developfrom
feature/1223-metric-ground-truth-harness
Nov 23, 2026
Merged

michalharakal merged 2 commits into
developfrom
feature/1223-metric-ground-truth-harness

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

What

Phases 1 and 2 of SKEEP-009. This branch is stacked on #1561 (the spike) and contains its commit; merging this PR alone delivers both.

  • MetricExecutor: precision, recall and f1 registered (op.average = macro / micro / binary, required for them), plus validate(case, tolerance = 1e-6). It compares the value with the reference and checks the stateful contract: after reset() the metric returns what a new instance returns, and the same batches give the same value again.
  • GroundTruthValidator.validateMetric(testCase, ctx, tolerance); validate() on a metric case fails with a message that points to it.
  • TS-008 integration test: every case goes through validateMetric, and each of accuracy, precision, recall and f1 must have a multi-batch case.
  • ground-truth.yml: a change under nn/metrics/ starts the workflow.
  • Docs: the metrics how-to no longer says ground truth is pending; SKEEP-009 gets an implementation-status table. Status: Draft is left for a maintainer to change.
  • MetricExecutorTest: 14 hand-built cases, no Docker needed.

One difference from the SKEEP sketch: GroundTruthValidator has no execution context, so validateMetric takes one.

Depends on

SKaiNET-developers/skainet-ground-truth#5 (the 30 precision / recall / F1 fixtures). Merge that first; the Ground Truth Validation job here is red until then, because the test requires a multi-batch case for every metric.

Test

With fixtures generated locally from that branch: 32 of 32 TS-008 cases pass (largest difference about 3e-8, from the F32 expected value); MetricExecutorTest 14 of 14; GroundTruthValidationTest 13 of 13. The older suites were run against the spike image before (TS-001, TS-003, TS-006 pass). The docs site builds with no new warning.

Refs #1223

🤖 Generated with Claude Code

michalharakal and others added 2 commits November 23, 2026 16:41
GroundTruthMetricCase, toMetricCase() and a MetricExecutor with Accuracy
registered. GroundTruthLoader keeps string op.* values. New TS-008
integration test compares with scikit-learn fixtures; hand-built cases
test the path without Docker.

Refs #1223

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…09 phases 1 and 2)

MetricExecutor registers precision, recall and f1 (op.average) and gains
validate(): value against the reference plus the reset() contract.
GroundTruthValidator.validateMetric; validate() points a metric case to
it. The TS-008 test runs every case and requires a multi-batch case per
metric. The ground-truth workflow also starts on changes under
nn/metrics/. The metrics how-to no longer says ground truth is pending.

Refs #1223

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📖 Documentation Preview

The documentation has been built successfully for this PR.

Generated Files:

  • Operator documentation: docs/modules/operators/_generated_/
  • JSON schema output: operators.json

Artifacts:

  • Download the documentation-preview-1562 artifact to view the complete documentation locally.

This comment will be updated automatically when the PR is updated.

@michalharakal
michalharakal merged commit b1dc6a5 into develop Nov 23, 2026
20 of 21 checks passed
@michalharakal
michalharakal deleted the feature/1223-metric-ground-truth-harness branch November 23, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant