| 84 | } |
| 85 | |
| 86 | void 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 | |
| 103 | void TestLogisticRegressionBasic(const Context* ctx) { |
| 104 | std::string obj_name = "reg:logistic"; |
no test coverage detected