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
37 stars 14 forks source link

Automated weights column checks through BaseTransformer #221

Closed limlam96 closed 2 months ago

limlam96 commented 2 months ago

What? Many transformers rely on a weights column, and many contain duplicated checks on this column. BaseTransformer implements a check_weights_column method, but this is not called by BaseTransformer.fit/transform - if there are no objections suggest automatically calling this when weight_column is provided. Can then capture appropriate tests in one of the generic test classes, and delete duplicated checks across transformers.

limlam96 commented 2 months ago

Leaning towards having a light WeightedBaseTransformer class that inherits from BaseTransformer and handles this stuff. Transformers would then have to inherit from the appropriate parent class

adamsardar commented 2 months ago

If you're considering a lightweight class, consider using a mixin?