Skip to content

refactor(metrics): extract classification helpers from Accuracy (#1222) - #1429

Merged
michalharakal merged 2 commits into
SKaiNET-developers:developfrom
EdinEd:feature/1225-extract-accuracy-helpers
Oct 20, 2026
Merged

michalharakal merged 2 commits into
SKaiNET-developers:developfrom
EdinEd:feature/1225-extract-accuracy-helpers

Conversation

@EdinEd

@EdinEd EdinEd commented Oct 20, 2026

Copy link
Copy Markdown

Preparatory refactor for the Precision, Recall, and F1 metrics feature (DARC parent #1222).

Extracts internal classification helpers (argmax, shape validation, target-dispatch, and sample traversal) from Accuracy.kt into an internal object ClassificationSupport. This avoids triple duplication across upcoming metrics and unblocks Lane 2's accumulator (#1226).

Closes #1225
Refs #1222

Edwin added 2 commits October 20, 2026 14:29
- accuracy calls central "forEachPrediction" method for accumulation
- helper functions are no longer private
…rt (SKaiNET-developers#1222)

    - Split forEachPrediction into forEachWithIndexTargets and forEachWithSoftTargets
      for clear separation between Int32 hard indices and FP32/FP16 soft targets.
    - Factor out duplicated sample traversal into iteratePredictions and class
      prediction resolution into predictClass.
    - Use inline and crossinline to maintain zero-allocation performance.
    - Remove obsolete DType imports from Accuracy.kt.

@michalharakal michalharakal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michalharakal
michalharakal merged commit dfe075c into SKaiNET-developers:develop Oct 20, 2026
18 checks passed
@michalharakal

Copy link
Copy Markdown
Contributor

@EdinEd Thank you

michalharakal added a commit that referenced this pull request Oct 21, 2026
CHANGELOG [0.62.0] - 2026-10-21 with the parity headline over #1363, #1364,
#1368, #1369, #1426, #1427, #1428 and #1430, plus entries for the operator
coverage matrix (#1370), the BitNet decode allocation and threading fixes
(#1359, #1360, #1361, #1362), the ClassificationSupport extraction (#1429)
and the toolchain bumps (Kotlin 2.4.21, kotest 6.2.6, Gradle 9.8.1).
VERSION_NAME, CITATION, Antora version, README bom coordinate, What's New
and contributors, Android tutorial coordinates; regenerated operator and
kernel-support matrices; SKEEP-007 rollout step 3 marked shipped.
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 2 · kotlin-core] Precision/Recall/F1 — extract Accuracy's class-matching helpers into a shared internal file

2 participants