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

Function TestPoissonRegressionGPair

tests/cpp/objective/test_regression_obj.cc:146–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void TestPoissonRegressionGPair(const Context* ctx) {
147 std::vector<std::pair<std::string, std::string>> args;
148 std::unique_ptr<ObjFunction> obj{ObjFunction::Create("count:poisson", ctx)};
149
150 args.emplace_back("max_delta_step", "0.1f");
151 obj->Configure(args);
152 // clang-format off
153 CheckObjFunction(obj,
154 { 0, 0.1f, 0.9f, 1, 0, 0.1f, 0.9f, 1},
155 { 0, 0, 0, 0, 1, 1, 1, 1},
156 { 1, 1, 1, 1, 1, 1, 1, 1},
157 { 1, 1.10f, 2.45f, 2.71f, 0, 0.10f, 1.45f, 1.71f},
158 {1.10f, 1.22f, 2.71f, 3.00f, 1.10f, 1.22f, 2.71f, 3.00f});
159 CheckObjFunction(obj,
160 { 0, 0.1f, 0.9f, 1, 0, 0.1f, 0.9f, 1},
161 { 0, 0, 0, 0, 1, 1, 1, 1},
162 {}, // Empty weight
163 { 1, 1.10f, 2.45f, 2.71f, 0, 0.10f, 1.45f, 1.71f},
164 {1.10f, 1.22f, 2.71f, 3.00f, 1.10f, 1.22f, 2.71f, 3.00f});
165 // clang-format on
166}
167
168void TestPoissonRegressionBasic(const Context* ctx) {
169 std::vector<std::pair<std::string, std::string>> args;

Callers 2

TESTFunction · 0.85
TESTFunction · 0.85

Calls 2

CheckObjFunctionFunction · 0.85
ConfigureMethod · 0.45

Tested by

no test coverage detected