Skip to content

Commit

Permalink
FIX add condition on impute_missing
Browse files Browse the repository at this point in the history
  • Loading branch information
PSSF23 authored Jul 9, 2024
1 parent 9126a9d commit 3e2cda8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sktree/ensemble/_honest_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,8 @@ def _predict_proba(self, X, indices=None, impute_missing=None):
zero_mask = posteriors.sum(2) == 0
posteriors[~zero_mask] /= posteriors[~zero_mask].sum(1, keepdims=True)

posteriors[zero_mask] = impute_missing
if impute_missing is not None:
posteriors[zero_mask] = impute_missing

# preserve shape of multi-outputs
if self.n_outputs_ > 1:
Expand Down

0 comments on commit 3e2cda8

Please sign in to comment.