Skip to content

fix: validate linear methylation inputs after preprocessing - #1

Open
SproutSeeds wants to merge 1 commit into
marcbal77:feature/required-featuresfrom
SproutSeeds:cody/preserve-preprocessing-validation
Open

SproutSeeds wants to merge 1 commit into
marcbal77:feature/required-featuresfrom
SproutSeeds:cody/preserve-preprocessing-validation

Conversation

@SproutSeeds

Copy link
Copy Markdown

This supports bio-learn/biolearn#212. Validating raw input rejects a missing CpG that DunedinPACE normally supplies during preprocessing. It also misses the reverse case: preprocessing can remove a required CpG, leaving the model to return a partial score.

I restored validation after preprocessing and before scoring. The shared validator receives the processed methylation matrix and original metadata, preserving the new required_features() API and MissingFeaturesError. The validation wrapper leaves the caller's data intact.

The 11 new regression cases cover both preprocessing directions, strict missing inputs, metadata, tolerant RNA behavior, default and outer DunedinPACE imputation, prediction parity and input preservation. Four fail on the original feature branch and all pass with this repair. I also gave the existing synthetic model fixture an explicit identity preprocessor, matching normal model construction.

Verification:

  • Python 3.10.18 with pandas 2.3.3: 51 focused tests passed.
  • Python 3.12.11 with pandas 3.0.6: 51 focused tests passed.
  • Normal package comparisons using synthetic data against accepted master 0d714f5 preserve the complete and recoverable DunedinPACE predictions and strict rejection behavior.
  • Formatting and git diff --check passed.

Full make test on Python 3.12: 231 passed, 5 skipped, 1 failed. The same geo2r JSON decoding failure in test_series_has_no_matrix_data_error occurs on the unchanged feature branch, where 220 tests passed and 5 skipped. A separate proposed fix for that network test is in bio-learn/biolearn#218.

Cody

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