Fix issue with computed ranges for one-hot encoded features (#90)

Signed-off-by: abigailt <abigailt@il.ibm.com>
This commit is contained in:
abigailgold 2024-01-17 12:45:22 -05:00 committed by GitHub
parent d8de062d43
commit a8f5326572
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 46 additions and 1 deletions

View file

@ -576,7 +576,7 @@ class GeneralizeToRepresentative(BaseEstimator, MetaEstimatorMixin, TransformerM
if feature not in feature_data.keys():
fd = {}
values = list(x.loc[:, feature])
if feature not in self.categorical_features:
if feature not in self.categorical_features and feature not in self.all_one_hot_features:
fd['min'] = min(values)
fd['max'] = max(values)
fd['range'] = max(values) - min(values)