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

Method RunTest

tests/cpp/tree/test_tree_stat.cc:407–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405class TestMaxDeltaStep : public ::testing::Test {
406 public:
407 void RunTest(Context const* ctx, std::string const& updater, bst_target_t n_targets) {
408 bst_idx_t n_samples = 4096;
409 bst_feature_t n_features = 32;
410 auto p_fmat = RandomDataGenerator(n_samples, n_features, .0f)
411 .Seed(3)
412 .Targets(n_targets)
413 .GenerateDMatrix(true);
414 auto gpairs = GenerateRandomGradients(ctx, n_samples, n_targets);
415
416 RegTree tree_0{static_cast<bst_target_t>(gpairs.gpair.Shape(1)),
417 static_cast<bst_target_t>(p_fmat->Info().num_col_)};
418 BuildTree(ctx, p_fmat.get(), &gpairs, updater, Args{{"max_delta_step", std::to_string(0.5)}}, &tree_0);
419 ASSERT_EQ(tree_0.NumNodes(), 1);
420 }
421};
422
423TEST_F(TestMaxDeltaStep, Hist) {

Callers

nothing calls this directly

Calls 10

RandomDataGeneratorClass · 0.85
GenerateRandomGradientsFunction · 0.85
BuildTreeFunction · 0.85
GenerateDMatrixMethod · 0.80
SeedMethod · 0.80
ShapeMethod · 0.80
NumNodesMethod · 0.80
TargetsMethod · 0.45
InfoMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected