-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
The file 4.2 Preprocess.ipynb has this part for replacing NaN and Infinity values
`
df.iloc[:, df.columns != "Label"] = df.groupby("Label").transform(lambda x: x.fillna(x.mean()))
df = df.replace([np.inf], np.nan)
df.iloc[:, df.columns != "Label"] = df.groupby("Label").transform(lambda x: x.fillna(x.max()))`
However, replacing like this is not a good strategy, because the mean() actually takes into account the Infinity (np.inf) values, and making the mean values become Infinity.
Metadata
Metadata
Assignees
Labels
No labels