Skip to content

Commit

Permalink
SklImpute: use ReplaceUnknowns directly
Browse files Browse the repository at this point in the history
  • Loading branch information
markotoplak committed Jul 11, 2023
1 parent 6664732 commit 703fe5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Orange/preprocess/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def __call__(self, data):
# drop the ones which do not have valid `imputer.statistics_`
# (i.e. all NaN columns). `sklearn.preprocessing.Imputer` already
# drops them from the transformed X.
features = [impute.Average()(data, var, value)
features = [var.copy(compute_value=impute.ReplaceUnknowns(var, value))
for var, value in zip(data.domain.attributes,
imputer.statistics_)
if not np.isnan(value)]
Expand Down

0 comments on commit 703fe5e

Please sign in to comment.