Skip to content

[codex] Balance family training data - #31

Merged
henry3260 merged 1 commit into
mainfrom
codex/balance-family-training
Jun 11, 2026
Merged

[codex] Balance family training data#31
henry3260 merged 1 commit into
mainfrom
codex/balance-family-training

Conversation

@henry3260

Copy link
Copy Markdown
Owner

Summary

  • add a reusable deterministic helper that downsamples grouped fingerprints to the smallest non-empty family
  • balance family data by default for train and build-templates
  • expose --balance/--no-balance and --balance-seed CLI options
  • report original and selected sample counts during training/template builds

Why

Uneven family counts can bias classifier training and family-template calibration. Using the same deterministic seed lets both workflows select the same balanced family-level dataset without deleting raw fingerprints.

Tests

  • python -m pytest tests/training_data/test_training_data.py
  • python -m pytest

Result: 43 passed, 3 existing datetime.utcnow() deprecation warnings.

Notes

  • generated model/*.joblib artifacts are intentionally excluded
  • model-version templates are intentionally unchanged because family-level balancing does not apply to that workflow

@henry3260
henry3260 marked this pull request as ready for review June 11, 2026 07:41
@henry3260
henry3260 merged commit a060959 into main Jun 11, 2026
2 checks passed
@henry3260
henry3260 deleted the codex/balance-family-training branch June 11, 2026 07:41
henry3260 added a commit that referenced this pull request Jun 11, 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