Skip to content

Commit de2195c

Browse files
committed
Fit Honest leaves after building pruned tree
1 parent 2d31df5 commit de2195c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

treeple/tree/_honest_tree.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,12 @@ def _fit_leaves(self, X, y, sample_weight):
752752
pruned_tree, self.tree_, pruner, X, y, sample_weight, missing_values_in_feature_mask
753753
)
754754
self.tree_ = pruned_tree
755+
756+
# Fit leaves using other subsample
757+
honest_leaves = self.tree_.apply(X[self.honest_indices_])
758+
759+
# y-encoded ensures that y values match the indices of the classes
760+
self._set_leaf_nodes(honest_leaves, y, sample_weight)
755761

756762
if self.n_outputs_ == 1:
757763
self.n_classes_ = self.n_classes_[0]

0 commit comments

Comments
 (0)