|
22 | 22 |
|
23 | 23 |
|
24 | 24 | def _create_column_transformer( |
25 | | - preprocessors: Dict[str], |
| 25 | + preprocessors: Dict, |
26 | 26 | numerical_columns: List[str], |
27 | 27 | categorical_columns: List[str], |
28 | 28 | ) -> ColumnTransformer: |
@@ -329,14 +329,14 @@ def _get_columns_info( |
329 | 329 | # Make sure each column is a valid type |
330 | 330 | for i, column in enumerate(X.columns): |
331 | 331 | column_dtype = self.dtypes[i] |
332 | | - if column_dtype.name in ['category', 'bool']: |
| 332 | + if column_dtype in ['category', 'bool']: |
333 | 333 | categorical_columns.append(column) |
334 | 334 | feat_type.append('categorical') |
335 | 335 | # Move away from np.issubdtype as it causes |
336 | 336 | # TypeError: data type not understood in certain pandas types |
337 | 337 | elif not is_numeric_dtype(column_dtype): |
338 | 338 | # 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': |
340 | 340 | raise ValueError( |
341 | 341 | "Input Column {} has invalid type object. " |
342 | 342 | "Cast it to a valid dtype before using it in AutoPyTorch. " |
@@ -368,7 +368,7 @@ def _get_columns_info( |
368 | 368 | "Make sure your data is formatted in a correct way, " |
369 | 369 | "before feeding it to AutoPyTorch.".format( |
370 | 370 | column, |
371 | | - column_dtype.name, |
| 371 | + column_dtype, |
372 | 372 | ) |
373 | 373 | ) |
374 | 374 | else: |
|
0 commit comments