xgboost_lib-sys 3.0.5

Native bindings to the xgboost library
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <gtest/gtest.h>
#include <xgboost/objective.h>
#include <string>
#include "../helpers.h"

namespace xgboost {
TEST(Plugin, ExampleObjective) {
  xgboost::Context ctx = MakeCUDACtx(GPUIDX);
  auto* obj = xgboost::ObjFunction::Create("mylogistic", &ctx);
  ASSERT_EQ(obj->DefaultEvalMetric(), std::string{"logloss"});
  delete obj;
}
}  // namespace xgboost