Skip to content
Merged
Show file tree
Hide file tree
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: 4 additions & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
* Improve accuracy of anomaly detection median estimation. (See {ml-pull}2367[#2367],
issue: {ml-issue}2364[#2364].)

=== Bug Fixes

* Fix potential cause of classification and regression job failures. (See {ml-pull}2385[#2385].)

== {es} version 8.3.0

=== Enhancements
Expand Down
17 changes: 9 additions & 8 deletions lib/maths/analytics/CBoostedTreeImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1663,16 +1663,17 @@ CBoostedTreeImpl::trainTree(core::CDataFrame& frame,
this->nodeFeatureBag(treeFeatureBag, featureSampleProbabilities, nodeFeatureBag);
nodeFeatureBag = merge(featuresToInclude, std::move(nodeFeatureBag));

std::size_t numberSplittableLeaves{splittableLeaves.size()};
std::size_t currentNumberInternalNodes{(tree.size() - 1) / 2};
auto numberSplittableLeaves =
static_cast<std::ptrdiff_t>(splittableLeaves.size());
auto currentNumberInternalNodes = static_cast<std::ptrdiff_t>(tree.size() - 1) / 2;
auto lastPotentialSplit = numberSplittableLeaves + currentNumberInternalNodes -
static_cast<std::ptrdiff_t>(maximumNumberInternalNodes);
auto smallestCurrentCandidateGainIndex =
static_cast<std::ptrdiff_t>(numberSplittableLeaves) -
static_cast<std::ptrdiff_t>(maximumNumberInternalNodes - currentNumberInternalNodes);
std::min(lastPotentialSplit, numberSplittableLeaves - 1);
double smallestCandidateGain{
smallestCurrentCandidateGainIndex >= 0
? splittableLeaves[static_cast<std::size_t>(smallestCurrentCandidateGainIndex)]
->gain()
: 0.0};
smallestCurrentCandidateGainIndex < 0
? 0.0
: splittableLeaves[smallestCurrentCandidateGainIndex]->gain()};

TLeafNodeStatisticsPtr leftChild;
TLeafNodeStatisticsPtr rightChild;
Expand Down