Skip to content

Commit 217c38d

Browse files
committed
Fixing bugs in implementation
1 parent 65e8ffb commit 217c38d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

autoPyTorch/data/tabular_feature_validator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,14 @@ def _get_columns_info(
337337
# Make sure each column is a valid type
338338
for i, column in enumerate(X.columns):
339339
column_dtype = self.dtypes[i]
340-
if column_dtype.name in ['category', 'bool']:
340+
if column_dtype in ['category', 'bool']:
341341
categorical_columns.append(column)
342342
feat_type.append('categorical')
343343
# Move away from np.issubdtype as it causes
344344
# TypeError: data type not understood in certain pandas types
345345
elif not is_numeric_dtype(column_dtype):
346346
# TODO verify how would this happen when we always convert the object dtypes to category
347-
if column_dtype.name == 'object':
347+
if column_dtype == 'object':
348348
raise ValueError(
349349
"Input Column {} has invalid type object. "
350350
"Cast it to a valid dtype before using it in AutoPyTorch. "
@@ -376,7 +376,7 @@ def _get_columns_info(
376376
"Make sure your data is formatted in a correct way, "
377377
"before feeding it to AutoPyTorch.".format(
378378
column,
379-
column_dtype.name,
379+
column_dtype,
380380
)
381381
)
382382
else:

0 commit comments

Comments
 (0)