lvgig / tubular

Python package implementing transformers for pre processing steps for machine learning.
https://tubular.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
38 stars 14 forks source link

Narwhalify ModeImputer #321

Open davidhopkinson26 opened 1 week ago

davidhopkinson26 commented 1 week ago

What

make ModeImputer polars compatible while maintaining backwards compatibility with pandas.

Why?

Making the project polars compatible for speed benefits. Narwhals allows us to do this piece by piece and maintain compatibility between components as it makes it possible to pass pandas dataframes to polars logic. This involves converting between pandas/polars dataframes.

How?

convert logic in ModeImputer to function with polars dataframes and add narwhalify decorators to methods to ensure compatibility with pandas dataframes.

Update testing where required.

limlam96 commented 3 days ago

think this will be relevant https://github.com/narwhals-dev/narwhals/issues/981