| 405 | class 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 | |
| 423 | TEST_F(TestMaxDeltaStep, Hist) { |
nothing calls this directly
no test coverage detected