Medial Code Documentation
|
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>
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 Metric * | Create (const std::string &name, Context const *ctx) |
create a metric according to name. | |
Protected Attributes | |
Context const * | ctx_ {nullptr} |
interface of evaluation metric used to evaluate model performance. This has nothing to do with training, but merely act as evaluation purpose.
|
inlinevirtual |
Configure the Metric with the specified parameters.
args | arguments to the objective function. |
Reimplemented in xgboost::metric::EvalRankWithCache< Cache >, xgboost::metric::EvalRankWithCache< ltr::MAPCache >, xgboost::metric::EvalRankWithCache< ltr::NDCGCache >, and xgboost::metric::EvalRankWithCache< ltr::PreCache >.
create a metric according to name.
name | name of the metric. name can be in form metric[@]param and the name will be matched in the registry. |
ctx | A global context |
|
pure virtual |
Evaluate a metric with DMatrix as input.
preds | Prediction |
p_fmat | DMatrix that contains related information like labels. |
Implemented in xgboost::metric::EvalRankWithCache< Cache >, xgboost::metric::EvalRankWithCache< ltr::MAPCache >, xgboost::metric::EvalRankWithCache< ltr::NDCGCache >, xgboost::metric::EvalRankWithCache< ltr::PreCache >, and xgboost::MetricNoCache.
|
inlineoverridevirtual |
Load configuration from JSON object By default, metric has no internal configuration; override this function to maintain internal configuration.
in | JSON object containing the configuration |
Implements xgboost::Configurable.
|
pure virtual |
Implemented in xgboost::metric::EvalROCAUC, xgboost::metric::EvalPRAUC, xgboost::metric::EvalAMS, xgboost::metric::EvalRank, xgboost::metric::EvalCox, xgboost::metric::EvalRankWithCache< Cache >, xgboost::metric::EvalRankWithCache< ltr::MAPCache >, xgboost::metric::EvalRankWithCache< ltr::NDCGCache >, and xgboost::metric::EvalRankWithCache< ltr::PreCache >.
|
inlineoverridevirtual |
Save configuration to JSON object By default, metric has no internal configuration; override this function to maintain internal configuration.
out | pointer to output JSON object |
Implements xgboost::Configurable.