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> >&) {}
65 const MetaInfo &info,
bool distributed) = 0;
67 virtual const char*
Name()
const = 0;
87 :
public dmlc::FunctionRegEntryBase<MetricReg,
88 std::function<Metric* (const char*)> > {
104 #define XGBOOST_REGISTER_METRIC(UniqueId, Name) \
105 ::xgboost::MetricReg& __make_ ## MetricReg ## _ ## UniqueId ## __ = \
106 ::dmlc::Registry< ::xgboost::MetricReg>::Get()->__REGISTER__(Name)
108 #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:86
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 SaveConfig(Json *p_out) const override
Save configuration to JSON object By default, metric has no internal configuration; override this fun...
Definition: metric.h:51
void LoadConfig(Json const &) override
Load configuration from JSON object By default, metric has no internal configuration; override this f...
Definition: metric.h:44
virtual const char * Name() const =0
GenericParameter const * tparam_
Definition: metric.h:29
JsonString String
Definition: json.h:593
The input data structure of xgboost.
Data structure representing JSON format.
Definition: json.h:352
virtual double Eval(const HostDeviceVector< bst_float > &preds, const MetaInfo &info, bool distributed)=0
evaluate a specific metric
interface of evaluation metric used to evaluate model performance. This has nothing to do with traini...
Definition: metric.h:27
namespace of xgboost
Definition: base.h:110