xgboost
Classes | Namespaces | Macros
objective.h File Reference

interface of objective function used by xgboost. More...

#include <dmlc/registry.h>
#include <xgboost/base.h>
#include <xgboost/data.h>
#include <xgboost/host_device_vector.h>
#include <xgboost/model.h>
#include <xgboost/task.h>
#include <cstdint>
#include <functional>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for objective.h:

Go to the source code of this file.

Classes

class  xgboost::ObjFunction
 interface of objective function More...
 
struct  xgboost::ObjFunctionReg
 Registry entry for objective factory functions. More...
 

Namespaces

 xgboost
 namespace of xgboost
 

Macros

#define XGBOOST_REGISTER_OBJECTIVE(UniqueId, Name)
 Macro to register objective function. More...
 

Detailed Description

interface of objective function used by xgboost.

Copyright 2014-2023 by XGBoost Contributors

Author
Tianqi Chen, Kailong Chen

Macro Definition Documentation

◆ XGBOOST_REGISTER_OBJECTIVE

#define XGBOOST_REGISTER_OBJECTIVE (   UniqueId,
  Name 
)
Value:
static DMLC_ATTRIBUTE_UNUSED ::xgboost::ObjFunctionReg & \
__make_ ## ObjFunctionReg ## _ ## UniqueId ## __ = \
::dmlc::Registry< ::xgboost::ObjFunctionReg>::Get()->__REGISTER__(Name)

Macro to register objective function.

// example of registering a objective
XGBOOST_REGISTER_OBJECTIVE(LinearRegression, "reg:squarederror")
.describe("Linear regression objective")
.set_body([]() {
return new RegLossObj(LossType::kLinearSquare);
});
#define XGBOOST_REGISTER_OBJECTIVE(UniqueId, Name)
Macro to register objective function.
Definition: objective.h:157