8000 CLN GBDTs: don't split on last bin (explicitly) by NicolasHug · Pull Request #13919 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

CLN GBDTs: don't split on last bin (explicitly) #13919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sklearn/ensemble/_hist_gradient_boosting/splitting.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,9 @@ cdef class Splitter:
sum_gradient_left, sum_hessian_left = 0., 0.
n_samples_left = 0

for bin_idx in range(self.actual_n_bins[feature_idx]):
for bin_idx in range(self.actual_n_bins[feature_idx] - 1):
# Note that considering splitting on the last bin is useless since
# it would result in having 0 samples in the right node (forbidden)
n_samples_left += histograms[feature_idx, bin_idx].count
n_samples_right = n_samples_ - n_samples_left

Expand Down
0