Skip to content

feat: add FeatureScaler (standard / minmax) - #11

Merged
akifkulll merged 1 commit into
octacity-org:mainfrom
montionugera:fix/issue-4
Oct 23, 2026
Merged

akifkulll merged 1 commit into
octacity-org:mainfrom
montionugera:fix/issue-4

Conversation

@montionugera

Copy link
Copy Markdown
Contributor

Closes #4

Summary

  • Add FeatureScaler subclassing BasePreprocessor in src/preprocessing_toolkit/scaler.py supporting method="standard" ((x - mean) / std, ddof=0) and method="minmax" ((x - min) / (max - min)).
  • Scale numeric columns using training statistics stored in center_ and scale_, pass non-numeric columns through unchanged, preserve missing values, and set scale to 1.0 for constant columns.
  • Export FeatureScaler in src/preprocessing_toolkit/__init__.py.
  • Add unit and scikit-learn pipeline / GridSearchCV tests in tests/test_scaler.py.

Verification

  • ruff check && ruff format --check && pytest

@akifkulll

Copy link
Copy Markdown
Collaborator

Thanks @montionugera, and sorry for the wait. CI didn't run because workflows from first-time contributors need maintainer approval; it's approved now. Locally all 56 tests pass and ruff is clean. The implementation is clean and follows the base contract.
One non-blocking suggestion: a near-constant float column like [0.1+0.2, 0.3, 0.3] gets scale_ ≈ 4.5e-17 instead of 1.0, so floating-point noise is blown up. Treating scales that are tiny relative to the column's magnitude as zero (scikit-learn does something similar) would cover this. Happy to merge once CI is green.

@akifkulll akifkulll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@akifkulll
akifkulll merged commit e433f7d into octacity-org:main Oct 23, 2026
3 checks passed
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.

Add FeatureScaler (standard / minmax)

2 participants