7 #ifndef XGBOOST_METRIC_H_ 8 #define XGBOOST_METRIC_H_ 10 #include <dmlc/registry.h> 18 #include "../../src/common/host_device_vector.h" 32 const std::vector<std::pair<std::string, std::string> >& args) {}
39 template<
typename PairIter>
40 inline void Configure(PairIter begin, PairIter end) {
41 std::vector<std::pair<std::string, std::string> > vec(begin, end);
54 bool distributed) = 0;
56 virtual const char*
Name()
const = 0;
75 :
public dmlc::FunctionRegEntryBase<MetricReg,
76 std::function<Metric* (const char*)> > {
92 #define XGBOOST_REGISTER_METRIC(UniqueId, Name) \ 93 ::xgboost::MetricReg& __make_ ## MetricReg ## _ ## UniqueId ## __ = \ 94 ::dmlc::Registry< ::xgboost::MetricReg>::Get()->__REGISTER__(Name) 96 #endif // XGBOOST_METRIC_H_ Registry entry for Metric factory functions. The additional parameter const char* param gives the val...
Definition: metric.h:74
float bst_float
float type, used for storing statistics
Definition: base.h:89
virtual void Configure(const std::vector< std::pair< std::string, std::string > > &args)
Configure the Metric with the specified parameters.
Definition: metric.h:31
static Metric * Create(const std::string &name)
create a metric according to name.
void Configure(PairIter begin, PairIter end)
set configuration from pair iterators.
Definition: metric.h:40
The input data structure of xgboost.
virtual const char * Name() const =0
namespace of xgboost
Definition: base.h:79
defines configuration macros of xgboost.
virtual ~Metric()=default
virtual destructor
virtual bst_float 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:25