Skip to content

[MNT] migrate scaling module to narwhals - #979

Open
ojassharma7 wants to merge 4 commits into
feature-engine:narwhals-migrationfrom
ojassharma7:mnt/narwhals-scaling
Open

[MNT] migrate scaling module to narwhals#979
ojassharma7 wants to merge 4 commits into
feature-engine:narwhals-migrationfrom
ojassharma7:mnt/narwhals-scaling

Conversation

@ojassharma7

@ojassharma7 ojassharma7 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates feature_engine/scaling (MeanNormalisationScaler) so fit / transform / inverse_transform use narwhals for the mean / range / scaling math, returning a native dataframe of the same type as the input.

Context

Part of #965. @solegalli suggested scaling as a good first module. Variable selection (find_numerical_variables / friends) is still pandas-backed on this branch — as noted, pandas tests should pass; full polars support waits on the variable-handling work Sole is doing.

Test plan

  • pytest tests/test_scaling/ (pandas) — 8 passed locally
  • CI green against narwhals-migration

solegalli and others added 4 commits July 21, 2026 20:49
* update dataframe checks

* update dataframe checks take 2

* update dataframe checks take 3

* update docstrings

* refactor dataframe checks

* fix mypy error

* add missing type hints

* add missing matching error syntax

* finalise tests for df checks'
Use narwhals for MeanNormalisationScaler fit/transform/inverse_transform
math so the scaler can work with any dataframe backend narwhals supports.
Pandas unit tests continue to pass; polars auto variable-selection still
depends on upcoming variable_handling updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
@solegalli
solegalli force-pushed the narwhals-migration branch 3 times, most recently from 8fe8359 to ea95750 Compare July 31, 2026 12:30
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.

2 participants