Skip to content

Commit

Permalink
handle the scenario where there is one continuous bin and either miss…
Browse files Browse the repository at this point in the history
…ing or unseen bins
  • Loading branch information
paulbkoch committed Dec 24, 2024
1 parent 5962f83 commit d9e1032
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion shared/libebm/PartitionOneDimensionalBoosting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,21 @@ template<bool bHessian, size_t cCompilerScores> class PartitionOneDimensionalBoo
// we can only sort if there's a single sortable index, so 1 score value
bNominal = 1 == cCompilerScores && bNominal && (0 == (TermBoostFlags_DisableCategorical & flags));

size_t cNormalBins = cBins;
if(bMissing) {
--cNormalBins;
}
if(bUnseen) {
--cNormalBins;
}
if(cNormalBins <= 1) {
// we could have just missing and unknown bins an no normal bins, or a normal bin plus missing and/or unseen.
bMissing = false;
bUnseen = false;
}

// Disable missing if there are only 2 bins, because we'll end up just combining the bins always then.
bMissing = bMissing && 2 != cBins && (0 == (TermBoostFlags_MissingLow & flags));
bMissing = bMissing && (0 == (TermBoostFlags_MissingLow & flags));

auto* const aBins =
pBoosterShell->GetBoostingMainBins()
Expand Down

0 comments on commit d9e1032

Please sign in to comment.