Go to the documentation of this file.
7 #ifndef XGBOOST_OBJECTIVE_H_
8 #define XGBOOST_OBJECTIVE_H_
10 #include <dmlc/registry.h>
36 virtual void Configure(
const std::vector<std::pair<std::string, std::string> >& args) = 0;
87 :
public dmlc::FunctionRegEntryBase<ObjFunctionReg,
88 std::function<ObjFunction* ()> > {
103 #define XGBOOST_REGISTER_OBJECTIVE(UniqueId, Name) \
104 static DMLC_ATTRIBUTE_UNUSED ::xgboost::ObjFunctionReg & \
105 __make_ ## ObjFunctionReg ## _ ## UniqueId ## __ = \
106 ::dmlc::Registry< ::xgboost::ObjFunctionReg>::Get()->__REGISTER__(Name)
108 #endif // XGBOOST_OBJECTIVE_H_
interface of objective function
Definition: objective.h:25
virtual void EvalTransform(HostDeviceVector< bst_float > *io_preds)
transform prediction values, this is only called when Eval is called, usually it redirect to PredTran...
Definition: objective.h:63
virtual const char * DefaultEvalMetric() const =0
virtual bst_float ProbToMargin(bst_float base_score) const
transform probability value back to margin this is used to transform user-set base_score back to marg...
Definition: objective.h:72
Defines the abstract interface for different components in XGBoost.
virtual void PredTransform(HostDeviceVector< bst_float > *)
transform prediction values, this is only called when Prediction is called
Definition: objective.h:56
Definition: generic_parameters.h:15
A device-and-host vector abstraction layer.
defines configuration macros of xgboost.
static ObjFunction * Create(const std::string &name, GenericParameter const *tparam)
Create an objective function according to name.
GenericParameter const * tparam_
Definition: objective.h:27
Registry entry for objective factory functions.
Definition: objective.h:86
virtual void Configure(const std::vector< std::pair< std::string, std::string > > &args)=0
Configure the objective with the specified parameters.
virtual void GetGradient(const HostDeviceVector< bst_float > &preds, const MetaInfo &info, int iteration, HostDeviceVector< GradientPair > *out_gpair)=0
Get gradient over each of predictions, given existing information.
~ObjFunction() override=default
virtual destructor
The input data structure of xgboost.
namespace of xgboost
Definition: base.h:110
float bst_float
float type, used for storing statistics
Definition: base.h:119