xgboost
Public Member Functions | Static Public Member Functions | List of all members
xgboost::Metric Class Referenceabstract

interface of evaluation metric used to evaluate model performance. This has nothing to do with training, but merely act as evaluation purpose. More...

#include <metric.h>

Collaboration diagram for xgboost::Metric:
Collaboration graph

Public Member Functions

virtual void Configure (const std::vector< std::pair< std::string, std::string > > &args)
 Configure the Metric with the specified parameters. More...
 
template<typename PairIter >
void Configure (PairIter begin, PairIter end)
 set configuration from pair iterators. More...
 
virtual bst_float Eval (const HostDeviceVector< bst_float > &preds, const MetaInfo &info, bool distributed)=0
 evaluate a specific metric More...
 
virtual const char * Name () const =0
 
virtual ~Metric ()=default
 virtual destructor More...
 

Static Public Member Functions

static MetricCreate (const std::string &name)
 create a metric according to name. More...
 

Detailed Description

interface of evaluation metric used to evaluate model performance. This has nothing to do with training, but merely act as evaluation purpose.

Constructor & Destructor Documentation

◆ ~Metric()

virtual xgboost::Metric::~Metric ( )
virtualdefault

virtual destructor

Member Function Documentation

◆ Configure() [1/2]

virtual void xgboost::Metric::Configure ( const std::vector< std::pair< std::string, std::string > > &  args)
inlinevirtual

Configure the Metric with the specified parameters.

Parameters
argsarguments to the objective function.

◆ Configure() [2/2]

template<typename PairIter >
void xgboost::Metric::Configure ( PairIter  begin,
PairIter  end 
)
inline

set configuration from pair iterators.

Parameters
beginThe beginning iterator.
endThe end iterator.
Template Parameters
PairIteriterator<std::pair<std::string, std::string> >

◆ Create()

static Metric* xgboost::Metric::Create ( const std::string &  name)
static

create a metric according to name.

Parameters
namename of the metric. name can be in form metric[@]param and the name will be matched in the registry.
Returns
the created metric.

◆ Eval()

virtual bst_float xgboost::Metric::Eval ( const HostDeviceVector< bst_float > &  preds,
const MetaInfo info,
bool  distributed 
)
pure virtual

evaluate a specific metric

Parameters
predsprediction
infoinformation, including label etc.
distributedwhether a call to Allreduce is needed to gather the average statistics across all the node, this is only supported by some metrics

◆ Name()

virtual const char* xgboost::Metric::Name ( ) const
pure virtual
Returns
name of metric

The documentation for this class was generated from the following file: