Go to the documentation of this file.
7 #ifndef XGBOOST_METRIC_H_
8 #define XGBOOST_METRIC_H_
10 #include <dmlc/registry.h>
37 const std::vector<std::pair<std::string, std::string> >&) {}
63 bool distributed) = 0;
65 virtual const char*
Name()
const = 0;
85 :
public dmlc::FunctionRegEntryBase<MetricReg,
86 std::function<Metric* (const char*)> > {
102 #define XGBOOST_REGISTER_METRIC(UniqueId, Name) \
103 ::xgboost::MetricReg& __make_ ## MetricReg ## _ ## UniqueId ## __ = \
104 ::dmlc::Registry< ::xgboost::MetricReg>::Get()->__REGISTER__(Name)
106 #endif // XGBOOST_METRIC_H_
~Metric() override=default
virtual destructor
static Metric * Create(const std::string &name, GenericParameter const *tparam)
create a metric according to name.
Defines the abstract interface for different components in XGBoost.
Definition: generic_parameters.h:15
A device-and-host vector abstraction layer.
Registry entry for Metric factory functions. The additional parameter const char* param gives the val...
Definition: metric.h:84
defines configuration macros of xgboost.
virtual void Configure(const std::vector< std::pair< std::string, std::string > > &)
Configure the Metric with the specified parameters.
Definition: metric.h:36
void LoadConfig(Json const &) override
Load configuration from JSON object By default, metric has no internal configuration; override this f...
Definition: metric.h:44
void SaveConfig(Json *) const override
Save configuration to JSON object By default, metric has no internal configuration; override this fun...
Definition: metric.h:51
virtual const char * Name() const =0
GenericParameter const * tparam_
Definition: metric.h:29
The input data structure of xgboost.
Data structure representing JSON format.
Definition: json.h:345
interface of evaluation metric used to evaluate model performance. This has nothing to do with traini...
Definition: metric.h:27
virtual bst_float Eval(const HostDeviceVector< bst_float > &preds, const MetaInfo &info, bool distributed)=0
evaluate a specific metric
namespace of xgboost
Definition: base.h:110
float bst_float
float type, used for storing statistics
Definition: base.h:119