| 60 | } |
| 61 | |
| 62 | void TestSquaredLog(const Context* ctx) { |
| 63 | std::string obj_name = "reg:squaredlogerror"; |
| 64 | std::vector<std::pair<std::string, std::string>> args; |
| 65 | |
| 66 | std::unique_ptr<ObjFunction> obj{ObjFunction::Create(obj_name, ctx)}; |
| 67 | obj->Configure(args); |
| 68 | CheckConfigReload(obj, obj_name); |
| 69 | // clang-format off |
| 70 | CheckObjFunction(obj, |
| 71 | {0.1f, 0.2f, 0.4f, 0.8f, 1.6f}, // pred |
| 72 | {1.0f, 1.0f, 1.0f, 1.0f, 1.0f}, // labels |
| 73 | {1.0f, 1.0f, 1.0f, 1.0f, 1.0f}, // weights |
| 74 | {-0.5435f, -0.4257f, -0.25475f, -0.05855f, 0.1009f}, |
| 75 | { 1.3205f, 1.0492f, 0.69215f, 0.34115f, 0.1091f}); |
| 76 | CheckObjFunction(obj, |
| 77 | {0.1f, 0.2f, 0.4f, 0.8f, 1.6f}, // pred |
| 78 | {1.0f, 1.0f, 1.0f, 1.0f, 1.0f}, // labels |
| 79 | {}, // empty weights |
| 80 | {-0.5435f, -0.4257f, -0.25475f, -0.05855f, 0.1009f}, |
| 81 | { 1.3205f, 1.0492f, 0.69215f, 0.34115f, 0.1091f}); |
| 82 | // clang-format on |
| 83 | ASSERT_EQ(obj->DefaultEvalMetric(), std::string{"rmsle"}); |
| 84 | } |
| 85 | |
| 86 | void TestLogisticRegressionGPair(const Context* ctx) { |
| 87 | std::string obj_name = "reg:logistic"; |
no test coverage detected