MCPcopy Create free account
hub / github.com/dmlc/xgboost / TEST_P

Function TEST_P

tests/cpp/common/test_quantile.cc:239–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237} // namespace
238
239TEST_P(QuantileSummaryTest, Invariants) {
240 auto c = GetParam();
241 auto col = GenerateSummaryColumn(c);
242
243 WQuantileSketch row_sketch{c.rows, SketchEpsilon(c.max_bin, c.rows)};
244 for (std::size_t i = 0; i < col.values.size(); ++i) {
245 row_sketch.Push(col.values[i], col.weights[i]);
246 }
247 auto row_summary = row_sketch.GetSummary(SketchSummaryBudget(c.max_bin, c.rows));
248 TestSummaryInvariants(c, row_summary, col);
249
250 WQuantileSketch sorted_sketch{c.rows, SketchEpsilon(c.max_bin, c.rows)};
251 std::vector<::xgboost::Entry> sorted_col;
252 sorted_col.reserve(col.values.size());
253 for (std::size_t i = 0; i < col.values.size(); ++i) {
254 sorted_col.emplace_back(i, col.values[i]);
255 }
256 std::sort(sorted_col.begin(), sorted_col.end(), ::xgboost::Entry::CmpValue);
257 sorted_sketch.PushSorted(Span<::xgboost::Entry const>{sorted_col.data(), sorted_col.size()},
258 col.weights, c.max_bin);
259 auto sorted_summary = sorted_sketch.GetSummary(SketchSummaryBudget(c.max_bin, c.rows));
260 TestSummaryInvariants(c, sorted_summary, col);
261}
262
263INSTANTIATE_TEST_SUITE_P(Anchors, QuantileSummaryTest, ::testing::ValuesIn(SummaryAnchorCases()),
264 SummaryCaseName);

Callers

nothing calls this directly

Calls 15

GenerateSummaryColumnFunction · 0.85
SketchEpsilonFunction · 0.85
SketchSummaryBudgetFunction · 0.85
TestSummaryInvariantsFunction · 0.85
FeatureTypesFunction · 0.85
GenerateWeightsFunction · 0.85
CollectWeightedColumnsFunction · 0.85
ValidateContainerCutsFunction · 0.85
SketchOnDMatrixFunction · 0.85
TestDistributedGlobalFunction · 0.85
GetSummaryMethod · 0.80

Tested by

no test coverage detected