Skip to content

feat: refactor Individual metrics into ClassificationMetrics struct - #58

Merged
eprifti merged 4 commits into
mainfrom
feat/individual-metrics-refactor
Mar 24, 2026
Merged

eprifti merged 4 commits into
mainfrom
feat/individual-metrics-refactor

Conversation

@eprifti

@eprifti eprifti commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move classification-specific fields (auc, threshold, threshold_ci, sensitivity, specificity, accuracy, additional metrics) from flat Individual fields into a nested cls: ClassificationMetrics struct
  • Individual.auc → Individual.cls.auc, etc.
  • Individual.metrics (AdditionalMetrics) → Individual.cls.additional
  • fit stays on Individual as the universal penalized objective

Why

Enables future TaskMetrics enum for regression support (#15) without modifying any classification code. Separates concerns: classification metrics are grouped together, ready for a sibling RegressionMetrics struct.

Test plan

  • 756 lib tests pass (749 existing + 7 new refactor tests)
  • Serialization roundtrip (JSON, Bincode)
  • MCMC e2e tests pass (15/15)
  • Beam e2e tests pass (28/28)
  • Consistency tests pass (4/4)
  • GA e2e tests (running, ~15min)

Refs #45

eprifti added 4 commits March 24, 2026 14:13
Move classification-specific fields (auc, threshold, threshold_ci,
sensitivity, specificity, accuracy, additional metrics) from flat
Individual fields into a nested ClassificationMetrics struct.

Individual.cls.auc replaces Individual.auc, etc.

This separation enables future TaskMetrics enum for regression support
(spearman, r_squared, mse, mae) without modifying classification code.

All 749 lib tests pass. Serialization format updated (cls is a nested
object, not flattened).

Refs #45
@eprifti
eprifti merged commit 9db9aca into main Mar 24, 2026
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