[Lane 2 · kotlin-core] Recall metric
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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 内容生成。
描述
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
- Add
public class Recall(averaging: Averaging = Averaging.MACRO, dim: Int = -1, threshold: Float? = null) : Metric
inskainet-lang/skainet-lang-core/src/commonMain/kotlin/sk/ainet/lang/nn/metrics/Recall.kt:override val name = "recall";update(...)delegates to a privateConfusionMatrixAccumulator(dim, threshold);compute()=reduce(acc.counts(), averaging) { tp, fp, fn -> if (tp + fn == 0L) 0.0 else tp.toDouble() / (tp + fn) };reset()delegates.
MirrorAccuracy.kt's KDoc style (what the metric means, thedim/thresholdsemantics, whataveragingdoes).
- Add factory functions at the bottom of the file mirroring
accuracy()/binaryAccuracy():
public fun recall(averaging: Averaging = Averaging.MACRO, dim: Int = -1): Metricand
public fun binaryRecall(threshold: Float = 0.5f): Metric. - Tests in
skainet-backends/skainet-backend-cpu/src/commonTest/kotlin/sk/ainet/exec/metrics/RecallTest.kt,
copyingAccuracyTest.kt's tensor helpers. Cover, with hand-computed expected values
(see the parent issue and #1224 for the reference fixturepred [2,0,1,2],target [2,1,1,0]):- macro multi-class with
Int32index targets → 0.5; - micro multi-class → 0.5 (and assert it equals
Accuracyon the same batch); - the same batch with soft (
FP32one-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 returns0.0.
- macro multi-class with
./gradlew :skainet-lang:skainet-lang-core:apiDumpand
./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 天 1 小时
- 30 天内合并 PR
- 41
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SKaiNET-developers/SKaiNET 的其他 Issue
-
coding good first issue platform size:xs skill:js sub-issue
难度 2/5 1-3 小时 新手友好度 72/100
SKaiNET-developers/SKaiNET#1232 ·
维护者通常 1 天内回复
-
enhancement platform skill:native sub-issue
难度 4/5 3-5 天 新手友好度 52/100
SKaiNET-developers/SKaiNET#1301 ·
维护者通常 1 天内回复
-
compute-backend skill:android tracking
难度 5/5 一周以上 新手友好度 20/100
SKaiNET-developers/SKaiNET#1282 ·
维护者通常 1 天内回复
-
compiler enhancement skill:numerics
难度 5/5 一周以上 新手友好度 35/100
SKaiNET-developers/SKaiNET#1281 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement skill:kotlin-core skill:numerics
难度 5/5 一周以上 新手友好度 25/100
SKaiNET-developers/SKaiNET#1280 · 1 条评论 ·
维护者通常 1 天内回复
查看 SKaiNET-developers/SKaiNET 的全部 Issue
相似的 Issue
-
bug follow-up
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
binding:web core docs p3
难度 2/5 1-3 小时 新手友好度 85/100
RunanywhereAI/runanywhere-sdks#1123 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
openai/openai-java#1202 ·
维护者通常 1 天内回复
-
StepExamBenchmarkTest runs a loop and prints a timing but asserts nothing可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭jules
难度 1/5 1 小时以内 新手友好度 82/100
open-learning-exchange/myplanet#18199 · 1 条评论 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
auth0/Auth0.Android#1095 · 1 条评论 ·
维护者通常 1 天内回复