Skip to content

Commit 99b2efe

Browse files
committed
Fixing bugs in implementation
1 parent d938c79 commit 99b2efe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

autoPyTorch/data/tabular_feature_validator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323

2424
def _create_column_transformer(
25-
preprocessors: Dict[str],
25+
preprocessors: Dict,
2626
numerical_columns: List[str],
2727
categorical_columns: List[str],
2828
) -> ColumnTransformer:
@@ -329,14 +329,14 @@ def _get_columns_info(
329329
# Make sure each column is a valid type
330330
for i, column in enumerate(X.columns):
331331
column_dtype = self.dtypes[i]
332-
if column_dtype.name in ['category', 'bool']:
332+
if column_dtype in ['category', 'bool']:
333333
categorical_columns.append(column)
334334
feat_type.append('categorical')
335335
# Move away from np.issubdtype as it causes
336336
# TypeError: data type not understood in certain pandas types
337337
elif not is_numeric_dtype(column_dtype):
338338
# TODO verify how would this happen when we always convert the object dtypes to category
339-
if column_dtype.name == 'object':
339+
if column_dtype == 'object':
340340
raise ValueError(
341341
"Input Column {} has invalid type object. "
342342
"Cast it to a valid dtype before using it in AutoPyTorch. "
@@ -368,7 +368,7 @@ def _get_columns_info(
368368
"Make sure your data is formatted in a correct way, "
369369
"before feeding it to AutoPyTorch.".format(
370370
column,
371-
column_dtype.name,
371+
column_dtype,
372372
)
373373
)
374374
else:

0 commit comments

Comments
 (0)