Skip to content
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

Predefined bin thresholds #2325

Merged
merged 57 commits into from
Sep 28, 2019
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
fe5c8e2
Fix bug where small values of max_bin cause crash.
btrotta Jul 31, 2019
439bcfd
Revert "Fix bug where small values of max_bin cause crash."
btrotta Jul 31, 2019
34e72c8
Add functionality to force bin thresholds.
btrotta Aug 13, 2019
5b21573
Fix style issues.
btrotta Aug 14, 2019
2be599a
Use stable sort.
btrotta Aug 14, 2019
6a098f0
Minor style and doc fixes.
btrotta Aug 15, 2019
0cd4abc
Merge remote-tracking branch 'upstream/master'
btrotta Aug 16, 2019
8f73636
Add functionality to force bin thresholds.
btrotta Aug 13, 2019
6c2d048
Fix style issues.
btrotta Aug 14, 2019
feb861f
Use stable sort.
btrotta Aug 14, 2019
873fa64
Minor style and doc fixes.
btrotta Aug 15, 2019
050f57b
Merge branch 'force-bin' of https://github.com/btrotta/lightgbm into …
btrotta Aug 16, 2019
4cd89e4
Change binning behavior to be same as PR #2342.
btrotta Aug 20, 2019
698d9db
Merge remote-tracking branch 'upstream/master'
btrotta Aug 20, 2019
9d22071
Add functionality to force bin thresholds.
btrotta Aug 13, 2019
3178609
Fix style issues.
btrotta Aug 14, 2019
934b305
Use stable sort.
btrotta Aug 14, 2019
dc45bd1
Minor style and doc fixes.
btrotta Aug 15, 2019
018182c
Add functionality to force bin thresholds.
btrotta Aug 13, 2019
7a4df51
Fix style issues.
btrotta Aug 14, 2019
6095148
Use stable sort.
btrotta Aug 14, 2019
8b57a56
Minor style and doc fixes.
btrotta Aug 15, 2019
de83a69
Change binning behavior to be same as PR #2342.
btrotta Aug 20, 2019
01f18fd
Merge branch 'force-bin' of https://github.com/btrotta/lightgbm into …
btrotta Aug 20, 2019
360eacf
Merge remote-tracking branch 'upstream/master'
btrotta Sep 10, 2019
c478775
Add functionality to force bin thresholds.
btrotta Aug 13, 2019
e3f1835
Fix style issues.
btrotta Aug 14, 2019
2280c56
Minor style and doc fixes.
btrotta Aug 15, 2019
76fa4cc
Add functionality to force bin thresholds.
btrotta Aug 13, 2019
93d92eb
Fix style issues.
btrotta Aug 14, 2019
fec30a5
Minor style and doc fixes.
btrotta Aug 15, 2019
503e7b4
Change binning behavior to be same as PR #2342.
btrotta Aug 20, 2019
eecb80c
Add functionality to force bin thresholds.
btrotta Aug 13, 2019
a02b3a3
Fix style issues.
btrotta Aug 14, 2019
cb12379
Use stable sort.
btrotta Aug 14, 2019
abe95d7
Minor style and doc fixes.
btrotta Aug 15, 2019
7aed689
Add functionality to force bin thresholds.
btrotta Aug 13, 2019
35ce38b
Fix style issues.
btrotta Aug 14, 2019
28c0462
Use stable sort.
btrotta Aug 14, 2019
23dbb29
Minor style and doc fixes.
btrotta Aug 15, 2019
9ed04a3
Change binning behavior to be same as PR #2342.
btrotta Aug 20, 2019
7cdc732
Fix merge conflict.
btrotta Sep 10, 2019
51e93a9
Use different bin finding function for predefined bounds.
btrotta Sep 11, 2019
4e3355a
Fix style issues.
btrotta Sep 12, 2019
821b2ab
Minor refactoring, overload FindBinWithZeroAsOneBin.
btrotta Sep 12, 2019
8a52444
Fix style issues.
btrotta Sep 13, 2019
c591e7b
Fix bug and add new test.
btrotta Sep 17, 2019
9c767ae
Add warning when using categorical features with forced bins.
btrotta Sep 21, 2019
cf0afd4
Pass forced_upper_bounds by reference.
btrotta Sep 21, 2019
25387ec
Pass container types by const reference.
btrotta Sep 21, 2019
cc249f0
Get categorical features using FeatureBinMapper.
btrotta Sep 23, 2019
0e26e9f
Fix bug for small max_bin.
btrotta Sep 23, 2019
feeb163
Merge remote-tracking branch 'upstream/master'
btrotta Sep 26, 2019
50ff73b
Fix merge conflicts.
btrotta Sep 26, 2019
b5752ec
Move GetForcedBins to DatasetLoader.
btrotta Sep 27, 2019
58d86aa
Find forced bins in dataset_loader.
btrotta Sep 28, 2019
3e81b94
Minor fixes.
btrotta Sep 28, 2019
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
Prev Previous commit
Next Next commit
Use stable sort.
  • Loading branch information
btrotta committed Sep 10, 2019
commit 28c046205332312519d049ff536ed26c34f8dd43
4 changes: 2 additions & 2 deletions src/io/bin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace LightGBM {
if (num_to_insert > 0) {
bin_upper_bound.insert(bin_upper_bound.end(), forced_upper_bounds.begin(), forced_upper_bounds.begin() + num_to_insert);
}
std::sort(bin_upper_bound.begin(), bin_upper_bound.end());
std::stable_sort(bin_upper_bound.begin(), bin_upper_bound.end());

// find remaining bounds
std::vector<double> bounds_to_add;
Expand All @@ -238,7 +238,7 @@ namespace LightGBM {
bounds_to_add.insert(bounds_to_add.end(), new_upper_bounds.begin(), new_upper_bounds.end() - 1); // last bound is infinity
}
bin_upper_bound.insert(bin_upper_bound.end(), bounds_to_add.begin(), bounds_to_add.end());
std::sort(bin_upper_bound.begin(), bin_upper_bound.end());
std::stable_sort(bin_upper_bound.begin(), bin_upper_bound.end());
CHECK(bin_upper_bound.size() <= max_bin);
return bin_upper_bound;
}
Expand Down