xgboost
Classes | Namespaces | Macros
metric.h File Reference

interface of evaluation metric function supported in xgboost. More...

#include <dmlc/registry.h>
#include <xgboost/base.h>
#include <xgboost/data.h>
#include <xgboost/host_device_vector.h>
#include <xgboost/model.h>
#include <functional>
#include <memory>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for metric.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  xgboost::Metric
 interface of evaluation metric used to evaluate model performance. This has nothing to do with training, but merely act as evaluation purpose. More...
 
struct  xgboost::MetricReg
 Registry entry for Metric factory functions. The additional parameter const char* param gives the value after @, can be null. For example, metric map@3, then: param == "3". More...
 

Namespaces

 xgboost
 namespace of xgboost
 

Macros

#define XGBOOST_REGISTER_METRIC(UniqueId, Name)
 Macro to register metric. More...
 

Detailed Description

interface of evaluation metric function supported in xgboost.

Copyright 2014-2023 by XGBoost Contributors

Author
Tianqi Chen, Kailong Chen

Macro Definition Documentation

◆ XGBOOST_REGISTER_METRIC

#define XGBOOST_REGISTER_METRIC (   UniqueId,
  Name 
)
Value:
::xgboost::MetricReg& __make_ ## MetricReg ## _ ## UniqueId ## __ = \
::dmlc::Registry< ::xgboost::MetricReg>::Get()->__REGISTER__(Name)
Registry entry for Metric factory functions. The additional parameter const char* param gives the val...
Definition: metric.h:89

Macro to register metric.

// example of registering a objective ndcg@k
.describe("Rooted mean square error.")
.set_body([](const char* param) {
int at_k = atoi(param);
return new NDCG(at_k);
});
#define XGBOOST_REGISTER_METRIC(UniqueId, Name)
Macro to register metric.
Definition: metric.h:105