@@ -85,7 +85,7 @@ class TabularFeatureValidator(BaseFeatureValidator):
85
85
List for which an element at each index is a
86
86
list containing the categories for the respective
87
87
categorical column.
88
- transformed_columns (List[str])
88
+ enc_columns (List[str])
89
89
List of columns that were transformed.
90
90
column_transformer (Optional[BaseEstimator])
91
91
Hosts an imputer and an encoder object if the data
@@ -174,16 +174,16 @@ def _fit(
174
174
if not X .select_dtypes (include = 'object' ).empty :
175
175
X = self .infer_objects (X )
176
176
177
- self .transformed_columns , self .feat_type = self ._get_columns_to_encode (X )
177
+ self .enc_columns , self .feat_type = self ._get_columns_to_encode (X )
178
178
179
179
assert self .feat_type is not None
180
180
181
- if len (self .transformed_columns ) > 0 :
181
+ if len (self .enc_columns ) > 0 :
182
182
183
183
preprocessors = get_tabular_preprocessors ()
184
184
self .column_transformer = _create_column_transformer (
185
185
preprocessors = preprocessors ,
186
- categorical_columns = self .transformed_columns ,
186
+ categorical_columns = self .enc_columns ,
187
187
)
188
188
189
189
# Mypy redefinition
@@ -373,7 +373,7 @@ def _check_data(
373
373
374
374
# Define the column to be encoded here as the feature validator is fitted once
375
375
# per estimator
376
- self .transformed_columns , self .feat_type = self ._get_columns_to_encode (X )
376
+ self .enc_columns , self .feat_type = self ._get_columns_to_encode (X )
377
377
378
378
column_order = [column for column in X .columns ]
379
379
if len (self .column_order ) > 0 :
@@ -411,17 +411,17 @@ def _get_columns_to_encode(
411
411
checks) and an encoder fitted in the case the data needs encoding
412
412
413
413
Returns:
414
- transformed_columns (List[str]):
414
+ enc_columns (List[str]):
415
415
Columns to encode, if any
416
416
feat_type:
417
417
Type of each column numerical/categorical
418
418
"""
419
419
420
- if len (self .transformed_columns ) > 0 and self .feat_type is not None :
421
- return self .transformed_columns , self .feat_type
420
+ if len (self .enc_columns ) > 0 and self .feat_type is not None :
421
+ return self .enc_columns , self .feat_type
422
422
423
423
# Register if a column needs encoding
424
- transformed_columns = []
424
+ enc_columns = []
425
425
426
426
# Also, register the feature types for the estimator
427
427
feat_type = []
@@ -430,7 +430,7 @@ def _get_columns_to_encode(
430
430
for i , column in enumerate (X .columns ):
431
431
if X [column ].dtype .name in ['category' , 'bool' ]:
432
432
433
- transformed_columns .append (column )
433
+ enc_columns .append (column )
434
434
feat_type .append ('categorical' )
435
435
# Move away from np.issubdtype as it causes
436
436
# TypeError: data type not understood in certain pandas types
@@ -472,7 +472,7 @@ def _get_columns_to_encode(
472
472
)
473
473
else :
474
474
feat_type .append ('numerical' )
475
- return transformed_columns , feat_type
475
+ return enc_columns , feat_type
476
476
477
477
def list_to_dataframe (
478
478
self ,
0 commit comments