Skip to content

Commit

Permalink
fix size_t conversion issue that was failing to build on some compile…
Browse files Browse the repository at this point in the history
…rs in the sdist
  • Loading branch information
paulbkoch committed Jan 17, 2025
1 parent 1d45042 commit 2daf538
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/benchmarks/ebm-benchmark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"force_recreate = False\n",
"exist_ok = True\n",
"TIMEOUT_SEC = 60 * 60 * 24 * 180 # 180 days\n",
"wheel_filepaths = ['interpret_core-0.6.8-py3-none-any.whl', 'powerlift-0.1.12-py3-none-any.whl']\n",
"wheel_filepaths = ['interpret_core-0.6.9-py3-none-any.whl', 'powerlift-0.1.12-py3-none-any.whl']\n",
"\n",
"import datetime\n",
"experiment_name = datetime.datetime.now().strftime('%Y_%m_%d_%H%M__') + 'myexperiment'\n",
Expand Down
6 changes: 3 additions & 3 deletions shared/libebm/PartitionMultiDimensionalCorner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ template<bool bHessian, size_t cCompilerScores> class PartitionMultiDimensionalC
} while(cRealDimensions != iDimInit);
}

const size_t cTotalSamples = pTotal->GetCountSamples();
const size_t cTotalSamples = static_cast<size_t>(pTotal->GetCountSamples());

TensorSumDimension
aDimensions[k_dynamicDimensions == cCompilerDimensions ? k_cDimensionsMax : cCompilerDimensions];
Expand Down Expand Up @@ -286,8 +286,8 @@ template<bool bHessian, size_t cCompilerScores> class PartitionMultiDimensionalC
#endif // NDEBUG
);

if(cSamplesLeafMin <= pTempBin->GetCountSamples()) {
const size_t cSamplesOther = cTotalSamples - pTempBin->GetCountSamples();
if(cSamplesLeafMin <= static_cast<size_t>(pTempBin->GetCountSamples())) {
const size_t cSamplesOther = cTotalSamples - static_cast<size_t>(pTempBin->GetCountSamples());
if(cSamplesLeafMin <= cSamplesOther) {
EBM_ASSERT(1 <= cScores);
size_t iScore = 0;
Expand Down
5 changes: 3 additions & 2 deletions shared/libebm/tests/boosting_unusual_inputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,8 @@ static double RandomizedTesting(const AccelerationFlags acceleration) {
TermBoostFlags_PurifyUpdate,
// TermBoostFlags_GradientSums, // does not return a metric
TermBoostFlags_DisableNewtonUpdate,
TermBoostFlags_RandomSplits};
TermBoostFlags_RandomSplits,
TermBoostFlags_Corners};
std::vector<IntEbm> boostFlagsChoose{
TermBoostFlags_Default, TermBoostFlags_MissingLow, TermBoostFlags_MissingHigh, TermBoostFlags_MissingSeparate};

Expand Down Expand Up @@ -2367,7 +2368,7 @@ static double RandomizedTesting(const AccelerationFlags acceleration) {
}

TEST_CASE("stress test, boosting") {
const double expected = 12298977636064.098;
const double expected = 14219338182453.824;

double validationMetricExact = RandomizedTesting(AccelerationFlags_NONE);
CHECK(validationMetricExact == expected);
Expand Down

0 comments on commit 2daf538

Please sign in to comment.