Skip to content

refactor(utils): add static type annotations and fix validation logic in _validation.py - #1196

Open
mani787060 wants to merge 1 commit into
scikit-learn-contrib:masterfrom
mani787060:type-hints-validation
Open

refactor(utils): add static type annotations and fix validation logic in _validation.py#1196
mani787060 wants to merge 1 commit into
scikit-learn-contrib:masterfrom
mani787060:type-hints-validation

Conversation

@mani787060

Copy link
Copy Markdown

Description

This PR improves code quality, type safety, and internal logic consistency within imblearn/utils/_validation.py.

Summary of Changes

  • Added complete static type annotations across _validation.py.
  • Fixed typo in check_target_type exception string (multiclasss -> multiclass).
  • Corrected parameter mismatch in check_target_type docstring (indicate_one_vs_all).
  • Activated _is_neighbors_object validation inside check_neighbors_object.
  • Fixed internal method typos in ArraysTransformer (_transfrom_one -> _transform_one, _gets_props -> _get_props).
  • Reorganized module constants to the top level.

Checklist

  • Code adheres to the project's style guidelines.
  • Relevant functions have clear docstrings and typing annotations.

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