Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes
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>

Inheritance diagram for xgboost::Metric:
xgboost::Configurable xgboost::metric::EvalRankWithCache< ltr::MAPCache > xgboost::metric::EvalRankWithCache< ltr::NDCGCache > xgboost::metric::EvalRankWithCache< ltr::PreCache > xgboost::MetricNoCache xgboost::metric::EvalRankWithCache< Cache > xgboost::metric::EvalMAPScore xgboost::metric::EvalNDCG xgboost::metric::EvalPrecision xgboost::metric::EvalAUC< EvalPRAUC > xgboost::metric::EvalAUC< EvalROCAUC > xgboost::metric::EvalAMS xgboost::metric::EvalAUC< Curve > xgboost::metric::EvalCox xgboost::metric::EvalRank

Public Member Functions

virtual void Configure (const std::vector< std::pair< std::string, std::string > > &)
 Configure the Metric with the specified parameters.
 
void LoadConfig (Json const &) override
 Load configuration from JSON object By default, metric has no internal configuration; override this function to maintain internal configuration.
 
void SaveConfig (Json *p_out) const override
 Save configuration to JSON object By default, metric has no internal configuration; override this function to maintain internal configuration.
 
virtual double Evaluate (HostDeviceVector< bst_float > const &preds, std::shared_ptr< DMatrix > p_fmat)=0
 Evaluate a metric with DMatrix as input.
 
virtual const char * Name () const =0
 
 ~Metric () override=default
 virtual destructor
 

Static Public Member Functions

static MetricCreate (const std::string &name, Context const *ctx)
 create a metric according to name.
 

Protected Attributes

Context const * ctx_ {nullptr}
 

Detailed Description

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

Member Function Documentation

◆ Configure()

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

◆ Create()

Metric * xgboost::Metric::Create ( const std::string &  name,
Context const *  ctx 
)
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.
ctxA global context
Returns
the created metric.

◆ Evaluate()

virtual double xgboost::Metric::Evaluate ( HostDeviceVector< bst_float > const &  preds,
std::shared_ptr< DMatrix p_fmat 
)
pure virtual

◆ LoadConfig()

void xgboost::Metric::LoadConfig ( Json const &  )
inlineoverridevirtual

Load configuration from JSON object By default, metric has no internal configuration; override this function to maintain internal configuration.

Parameters
inJSON object containing the configuration

Implements xgboost::Configurable.

◆ Name()

virtual const char * xgboost::Metric::Name ( ) const
pure virtual

◆ SaveConfig()

void xgboost::Metric::SaveConfig ( Json p_out) const
inlineoverridevirtual

Save configuration to JSON object By default, metric has no internal configuration; override this function to maintain internal configuration.

Parameters
outpointer to output JSON object

Implements xgboost::Configurable.


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