Skip to content

Commit 5889caf

Browse files
committed
fix: test set has a column including nans, but this column does not contain nans in train set. Simple methodes can not impute this column.
1 parent 3c50162 commit 5889caf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

qolmat/imputations/imputers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,9 @@ def fit(self, X: pd.DataFrame, y=None) -> Self:
159159
else:
160160
self.ngroups_ = pd.Series(0, index=df.index).rename("_ngroup")
161161

162-
cols_with_nans = df.columns[df.isna().any()]
163162
self._setup_fit()
164163
if self.columnwise:
165-
for col in cols_with_nans:
164+
for col in df.columns:
166165
self._fit_allgroups(df[[col]], col=col)
167166
else:
168167
self._fit_allgroups(df)

0 commit comments

Comments
 (0)