Medial Code Documentation
Loading...
Searching...
No Matches
task.h
1
4#ifndef XGBOOST_TASK_H_
5#define XGBOOST_TASK_H_
6
7#include <xgboost/base.h>
8
9#include <cinttypes>
10
11namespace xgboost {
24struct ObjInfo {
25 // What kind of problem are we trying to solve
26 enum Task : uint8_t {
27 kRegression = 0,
28 kBinary = 1,
29 kClassification = 2,
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_
Copyright 2015-2023 by XGBoost Contributors.
#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
XGBOOST_DEVICE bool UpdateTreeLeaf() const
Use adaptive tree if the objective doesn't have valid hessian value.
Definition task.h:44