Skip to content

docs: precision, recall and F1 partials, how-to section, bit-exact platform test (#1234) - #1558

Merged
michalharakal merged 1 commit into
developfrom
feature/1234-precision-recall-f1-docs
Nov 23, 2026
Merged

michalharakal merged 1 commit into
developfrom
feature/1234-precision-recall-f1-docs

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Closes #1234. Supports #1232 and #1233.

What changes

  • Three partials in docs/modules/ROOT/partials/ops/metrics/ (precision, recall, f1score), each with math, intuition, examples and references tags. The math blocks state the per-class definition, macro / micro / binary averaging, the class set used for macro (classes seen in targets or predictions) and the zero-division convention (0.0).
  • How-to section Precision, recall and F1 in how-to/metrics-and-perf-testing.adoc. It includes the partials by tag; the definitions sit in collapsible blocks.
  • Examples are real code: tagged regions of ClassificationMetrics.kt, compiled by skainet-docs-samples and asserted in SamplesTest.
  • MetricsPlatformParityTest (skainet-backend-cpu commonTest): 6,000 samples in three batches, exact Double bits required for accuracy, precision, recall and F1 (macro and micro). The existing metric tests use a 1e-6 tolerance, so they could not show that targets agree bit for bit.

Verification

  • Documented numbers cross-checked with scikit-learn 1.3.2 (precision_recall_fscore_support, accuracy_score): the four-sample example, the imbalanced example, and the 6,000-sample batch, where the bits are identical.
  • sk.ainet.exec.metrics.* (5 suites, 49 tests, 0 failures) on jvmTest, linuxX64Test, jsBrowserTest, wasmJsBrowserTest, wasmWasiNodeTest.
  • :skainet-docs-samples:jvmTest: 6 tests, 0 failures.
  • Antora site built locally with the docs container: no unresolved includes on the page, six stem blocks emitted. I checked the generated HTML, not the page in a browser.
  • All ten reference links return HTTP 200; the claims next to them (zero division acts as 0, default label set, micro counts globally, torchmetrics zero_division=0) were read on the pages.

Not in this PR

🤖 Generated with Claude Code

Three partials under partials/ops/metrics/ with math, intuition, examples and
references; a 'Precision, recall and F1' section in the metrics how-to. The
examples are tagged regions of ClassificationMetrics.kt, compiled and run by
skainet-docs-samples.

MetricsPlatformParityTest pins the exact Double bits of the metrics over 6,000
samples in commonTest, so every tested target must produce them (#1232, #1233).

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-1558 artifact to view the complete documentation locally.

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

@michalharakal
michalharakal merged commit 1941e21 into develop Nov 23, 2026
21 checks passed
@michalharakal
michalharakal deleted the feature/1234-precision-recall-f1-docs branch November 23, 2026 12:32
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.

[Lane 5 · docs] Precision/Recall/F1 — doc partials (math / intuition / examples / references)

1 participant