cobra icon indicating copy to clipboard operation
cobra copied to clipboard

Test if class is fitted on another attribute in categorical_data_processor.py

Open JanBenisek opened this issue 3 years ago • 0 comments

Currently, we test whether instance has been fitted based on two attributes:

https://github.com/PythonPredictions/cobra/blob/474650f1ba3f36aa87f3fd7e77724a10d5484401/cobra/preprocessing/categorical_data_processor.py#L248-L252

However, this will break if there is for example just one categorical variable and it has been skipped. The fit() will run but will not populate self._cleaned_categories_by_column and thus error will be raised.

Define fitted instance on another attribute (for example like in PreProcessor class where we have separate flag): https://github.com/PythonPredictions/cobra/blob/474650f1ba3f36aa87f3fd7e77724a10d5484401/cobra/preprocessing/preprocessor.py#L255

JanBenisek avatar Mar 16 '21 13:03 JanBenisek