Skip to content

Commit

Permalink
Fixing bugs in implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ArlindKadra committed Oct 1, 2021
1 parent d938c79 commit 99b2efe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autoPyTorch/data/tabular_feature_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


def _create_column_transformer(
preprocessors: Dict[str],
preprocessors: Dict,
numerical_columns: List[str],
categorical_columns: List[str],
) -> ColumnTransformer:
Expand Down Expand Up @@ -329,14 +329,14 @@ def _get_columns_info(
# Make sure each column is a valid type
for i, column in enumerate(X.columns):
column_dtype = self.dtypes[i]
if column_dtype.name in ['category', 'bool']:
if column_dtype in ['category', 'bool']:
categorical_columns.append(column)
feat_type.append('categorical')
# Move away from np.issubdtype as it causes
# TypeError: data type not understood in certain pandas types
elif not is_numeric_dtype(column_dtype):
# TODO verify how would this happen when we always convert the object dtypes to category
if column_dtype.name == 'object':
if column_dtype == 'object':
raise ValueError(
"Input Column {} has invalid type object. "
"Cast it to a valid dtype before using it in AutoPyTorch. "
Expand Down Expand Up @@ -368,7 +368,7 @@ def _get_columns_info(
"Make sure your data is formatted in a correct way, "
"before feeding it to AutoPyTorch.".format(
column,
column_dtype.name,
column_dtype,
)
)
else:
Expand Down

0 comments on commit 99b2efe

Please sign in to comment.