Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Lane 2 · kotlin-core] Recall metric

オープン
#1,228 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
kotlin

調査の方向性

First check the dependency on #1226, then read Accuracy.kt and ConfusionMatrixAccumulator. Implement Recall and its factory functions in Recall.kt, and add the listed cases in RecallTest.kt, following AccuracyTest.kt for tensor helpers. Run the specified API dump and JVM tests; done means the public API is included and all six cases pass.

索引モデルが issue の本文から書いたものです。

説明

coding good first issue size:s skill:kotlin-core sub-issue training

Sub-issue of #1222 (Precision, Recall and F1Score metrics).

Lane: 2 · Kotlin core
Skill needed: Kotlin. Read Accuracy.kt and ConfusionMatrixAccumulator first — this task is mostly wiring.
Size: s (~2–3 h)
Blocked by: #1226 (accumulator + Averaging)

What to do

  1. Add public class Recall(averaging: Averaging = Averaging.MACRO, dim: Int = -1, threshold: Float? = null) : Metric
    in skainet-lang/skainet-lang-core/src/commonMain/kotlin/sk/ainet/lang/nn/metrics/Recall.kt:
    • override val name = "recall";
    • update(...) delegates to a private ConfusionMatrixAccumulator(dim, threshold);
    • compute() = reduce(acc.counts(), averaging) { tp, fp, fn -> if (tp + fn == 0L) 0.0 else tp.toDouble() / (tp + fn) };
    • reset() delegates.
      Mirror Accuracy.kt's KDoc style (what the metric means, the dim / threshold semantics, what averaging does).
  2. Add factory functions at the bottom of the file mirroring accuracy() / binaryAccuracy():
    public fun recall(averaging: Averaging = Averaging.MACRO, dim: Int = -1): Metric and
    public fun binaryRecall(threshold: Float = 0.5f): Metric.
  3. Tests in skainet-backends/skainet-backend-cpu/src/commonTest/kotlin/sk/ainet/exec/metrics/RecallTest.kt,
    copying AccuracyTest.kt's tensor helpers. Cover, with hand-computed expected values
    (see the parent issue and #1224 for the reference fixture pred [2,0,1,2], target [2,1,1,0]):
    • macro multi-class with Int32 index targets → 0.5;
    • micro multi-class → 0.5 (and assert it equals Accuracy on the same batch);
    • the same batch with soft (FP32 one-hot) targets gives the same result;
    • binary with threshold, 2-class logits;
    • accumulation across two update() calls equals one call on the concatenated batch;
    • zero-division: a class with TP+FP+FN = 0 contributes 0.0 (per #1224), and
      compute() on a fresh metric returns 0.0.
  4. ./gradlew :skainet-lang:skainet-lang-core:apiDump and
    ./gradlew :skainet-backends:skainet-backend-cpu:jvmTest --tests "sk.ainet.exec.metrics.*".

Acceptance

  • Recall + recall() + binaryRecall() public and in the API dump
  • All six test cases above pass on JVM
  • No duplicated argmax / iteration logic — everything goes through the accumulator
  • PR links this issue and #1222; PR body states "unit tests only; ground-truth wiring tracked in SKEEP-005 (#1223)"

Notes

Recall answers "of what was actually positive, how much did I catch". The twin task #1227 (Precision) is the same shape with tp / (tp + fp) — filed separately so two people can each ship one.

主要言語
Kotlin
スター
52
フォーク
15
平均マージ
1日 15時間
マージ済み PR(30日)
36

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SKaiNET-developers/SKaiNET のほかの issue

SKaiNET-developers/SKaiNET の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。