Skip to content

Commit

Permalink
remove lossguide
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbkoch committed Dec 25, 2024
1 parent 64b85e0 commit b8a9fb1
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions shared/libebm/tests/boosting_unusual_inputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2031,35 +2031,35 @@ TEST_CASE("purified boosting and impure boosting different for impure input, reg
}
}

TEST_CASE("lossguide, boosting, regression") {
TestBoost test = TestBoost(Task_Regression,
{FeatureTest(5, true, true, false), FeatureTest(5, true, true, true)},
{{0}, {1}},
{
TestSample({0, 0}, 21),
TestSample({1, 1}, 10),
TestSample({2, 2}, 20),
TestSample({3, 3}, 30),
TestSample({4, 4}, 29),
},
{TestSample({0, 0}, 20.5)});

// boost continuous missing lossguide
double validationMetric = test.Boost(0, TermBoostFlags_Default).validationMetric;
CHECK_APPROX(validationMetric, 411.88702500000005);

// boost nominal missing lossguide
validationMetric = test.Boost(1, TermBoostFlags_Default).validationMetric;
CHECK_APPROX(validationMetric, 403.69047320250002);

// boost continuous missing lossguide
validationMetric = test.Boost(0, TermBoostFlags_Default).validationMetric;
CHECK_APPROX(validationMetric, 395.65703278577030);

double termScore;
termScore = test.GetCurrentTermScore(0, {0}, 0);
CHECK_APPROX(termScore, 0.40592050000000002);
}
//TEST_CASE("lossguide, boosting, regression") {
// TestBoost test = TestBoost(Task_Regression,
// {FeatureTest(5, true, true, false), FeatureTest(5, true, true, true)},
// {{0}, {1}},
// {
// TestSample({0, 0}, 21),
// TestSample({1, 1}, 10),
// TestSample({2, 2}, 20),
// TestSample({3, 3}, 30),
// TestSample({4, 4}, 29),
// },
// {TestSample({0, 0}, 20.5)});
//
// // boost continuous missing lossguide
// double validationMetric = test.Boost(0, TermBoostFlags_Default).validationMetric;
// CHECK_APPROX(validationMetric, 411.88702500000005);
//
// // boost nominal missing lossguide
// validationMetric = test.Boost(1, TermBoostFlags_Default).validationMetric;
// CHECK_APPROX(validationMetric, 403.69047320250002);
//
// // boost continuous missing lossguide
// validationMetric = test.Boost(0, TermBoostFlags_Default).validationMetric;
// CHECK_APPROX(validationMetric, 395.65703278577030);
//
// double termScore;
// termScore = test.GetCurrentTermScore(0, {0}, 0);
// CHECK_APPROX(termScore, 0.40592050000000002);
//}

static double RandomizedTesting(const AccelerationFlags acceleration) {
const IntEbm cTrainSamples = 211; // have some non-SIMD residuals
Expand Down Expand Up @@ -2174,12 +2174,12 @@ static double RandomizedTesting(const AccelerationFlags acceleration) {
return validationMetric;
}

//TEST_CASE("stress test, boosting") {
// const double expected = 26746562197367.172;
//
// double validationMetricExact = RandomizedTesting(AccelerationFlags_NONE);
// CHECK(validationMetricExact == expected);
//
// double validationMetricSIMD = RandomizedTesting(AccelerationFlags_ALL);
// CHECK_APPROX_TOLERANCE(validationMetricSIMD, expected, 1e-2);
//}
TEST_CASE("stress test, boosting") {
const double expected = 26746562197367.172;

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

double validationMetricSIMD = RandomizedTesting(AccelerationFlags_ALL);
CHECK_APPROX_TOLERANCE(validationMetricSIMD, expected, 1e-2);
}

0 comments on commit b8a9fb1

Please sign in to comment.