Skip to content

Commit b90d4df

Browse files
committed
[fix] Reduce changes
1 parent 31d1ff9 commit b90d4df

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

autoPyTorch/data/tabular_feature_validator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,14 @@ def transform(self, X: SupportedFeatTypes) -> Union[np.ndarray, spmatrix, pd.Dat
290290

291291
# Pandas related transformations
292292
if ispandas(X) and self.column_transformer is not None:
293+
if np.any(pd.isnull(X)):
294+
# After above check it means that if there is a NaN
295+
# the whole column must be NaN
296+
# Make sure it is numerical and let the pipeline handle it
297+
for column in X.columns:
298+
if X[column].isna().all():
299+
X[column] = pd.to_numeric(X[column])
300+
293301
X = self.column_transformer.transform(X)
294302

295303
# Sparse related transformations

0 commit comments

Comments
 (0)