Skip to content

Commit

Permalink
Merge pull request #196 from csinva/resid_calc_comments
Browse files Browse the repository at this point in the history
Add comment about residuals
  • Loading branch information
csinva authored Dec 30, 2023
2 parents 329f6ea + 2119158 commit 6efaa90
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions imodels/tree/figs.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ def fit(
y_residuals_per_tree[tree_num_] = deepcopy(y)

# subtract predictions of all other trees
# Since the current tree makes a constant prediction over the node being split,
# one may ignore its contributions to the residuals without affecting the impurity decrease.
for tree_num_other_ in range(len(self.trees_)):
if not tree_num_other_ == tree_num_:
y_residuals_per_tree[tree_num_] -= y_predictions_per_tree[
Expand Down

0 comments on commit 6efaa90

Please sign in to comment.