Skip to content

[BUG] fix: sklearn compat shim for validate_data import (closes #365)#374

Open
Blackphoenix-15 wants to merge 2 commits intogc-os-ai:mainfrom
Blackphoenix-15:fix/sklearn-validate-data-compat-365
Open

[BUG] fix: sklearn compat shim for validate_data import (closes #365)#374
Blackphoenix-15 wants to merge 2 commits intogc-os-ai:mainfrom
Blackphoenix-15:fix/sklearn-validate-data-compat-365

Conversation

@Blackphoenix-15
Copy link
Copy Markdown

Reference Issues/PRs

Fixes #365

What does this implement/fix? Explain your changes.

Replaces the direct from sklearn.utils.validation import validate_data import
with a compatibility shim that works across sklearn versions:

  • sklearn 1.0–1.5: validate_data only existed as self._validate_data() instance method
  • sklearn 1.6+: validate_data is available as a standalone function

The shim detects the sklearn version at runtime and defines validate_data accordingly, so the rest of the code works unchanged.

What should a reviewer concentrate their feedback on?

  • The compat shim at the top of _feature_classifier.py
  • Confirmed working with sklearn 1.4.0 and latest

Did you add any tests for the change?

No new tests added. Tested manually by importing pyaptamer.aptanet with sklearn 1.4.0.

Any other comments?

PR checklist

  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
  • Used pre-commit hooks when committing to ensure that code is compliant with hooks. Install hooks with pre-commit install.
    To run hooks independent of commit, execute pre-commit run --all-files

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.

[BUG] pyaptamer.aptanet import fails with scikit-learn 1.4 due to validate_data

1 participant