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

Function TestLogisticRegressionGPair

tests/cpp/objective/test_regression_obj.cc:86–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void TestLogisticRegressionGPair(const Context* ctx) {
87 std::string obj_name = "reg:logistic";
88 std::vector<std::pair<std::string, std::string>> args;
89 std::unique_ptr<ObjFunction> obj{ObjFunction::Create(obj_name, ctx)};
90
91 obj->Configure(args);
92 CheckConfigReload(obj, obj_name);
93 // clang-format off
94 CheckObjFunction(obj,
95 { 0, 0.1f, 0.9f, 1, 0, 0.1f, 0.9f, 1}, // preds
96 { 0, 0, 0, 0, 1, 1, 1, 1}, // labels
97 { 1, 1, 1, 1, 1, 1, 1, 1}, // weights
98 { 0.5f, 0.52f, 0.71f, 0.73f, -0.5f, -0.47f, -0.28f, -0.26f}, // out_grad
99 {0.25f, 0.24f, 0.20f, 0.19f, 0.25f, 0.24f, 0.20f, 0.19f}); // out_hess
100 // clang-format on
101}
102
103void TestLogisticRegressionBasic(const Context* ctx) {
104 std::string obj_name = "reg:logistic";

Callers 2

TESTFunction · 0.85
TESTFunction · 0.85

Calls 3

CheckConfigReloadFunction · 0.85
CheckObjFunctionFunction · 0.85
ConfigureMethod · 0.45

Tested by

no test coverage detected