xgboost
task.h
Go to the documentation of this file.
1 
4 #ifndef XGBOOST_TASK_H_
5 #define XGBOOST_TASK_H_
6 
7 #include <xgboost/base.h>
8 
9 #include <cinttypes>
10 
11 namespace xgboost {
24 struct ObjInfo {
25  // What kind of problem are we trying to solve
26  enum Task : uint8_t {
28  kBinary = 1,
30  kSurvival = 3,
31  kRanking = 4,
32  kOther = 5,
33  } task;
34  // Does the objective have constant hessian value?
35  bool const_hess{false};
36  bool zero_hess{false};
37 
38  ObjInfo(Task t) : task{t} {} // NOLINT
39  ObjInfo(Task t, bool khess, bool zhess) : task{t}, const_hess{khess}, zero_hess(zhess) {}
40 
44  XGBOOST_DEVICE bool UpdateTreeLeaf() const { return zero_hess; }
45 };
46 } // namespace xgboost
47 #endif // XGBOOST_TASK_H_
Defines configuration macros and basic types for xgboost.
#define XGBOOST_DEVICE
Tag function as usable by device.
Definition: base.h:64
namespace of xgboost
Definition: base.h:90
A struct returned by objective, which determines task at hand. The struct is not used by any algorith...
Definition: task.h:24
enum xgboost::ObjInfo::Task task
XGBOOST_DEVICE bool UpdateTreeLeaf() const
Use adaptive tree if the objective doesn't have valid hessian value.
Definition: task.h:44
bool zero_hess
Definition: task.h:36
ObjInfo(Task t)
Definition: task.h:38
bool const_hess
Definition: task.h:35
ObjInfo(Task t, bool khess, bool zhess)
Definition: task.h:39
Task
Definition: task.h:26
@ kBinary
Definition: task.h:28
@ kOther
Definition: task.h:32
@ kRegression
Definition: task.h:27
@ kSurvival
Definition: task.h:30
@ kRanking
Definition: task.h:31
@ kClassification
Definition: task.h:29