-
Notifications
You must be signed in to change notification settings - Fork 7
Test if class is fitted on another attribute in categorical_data_processor.py #49
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Milestone
Description
Currently, we test whether instance has been fitted based on two attributes:
cobra/cobra/preprocessing/categorical_data_processor.py
Lines 248 to 252 in 474650f
| if self.regroup and len(self._cleaned_categories_by_column) == 0: | |
| msg = ("{} instance is not fitted yet. Call 'fit' with " | |
| "appropriate arguments before using this method.") | |
| raise NotFittedError(msg.format(self.__class__.__name__)) |
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):
cobra/cobra/preprocessing/preprocessor.py
Line 255 in 474650f
| self._is_fitted = True # set fitted boolean to True |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers