xgboost
公有成员函数 | 静态公有成员函数 | 保护属性 | 所有成员列表
xgboost::Metric 类参考抽象类

用于评估模型性能的评估指标接口。这与训练无关,仅用于评估目的。 更多...

#include <metric.h>

xgboost::Metric 继承图
Inheritance graph
xgboost::Metric 协作图
Collaboration graph

公有成员函数

virtual void Configure (const std::vector< std::pair< std::string, std::string > > &)
 使用指定的参数配置 Metric更多...
 
void LoadConfig (Json const &) override
 从 JSON 对象加载配置 默认情况下,指标没有内部配置;重写此函数以维护内部配置。 更多...
 
void SaveConfig (Json *p_out) const override
 将配置保存到 JSON 对象 默认情况下,指标没有内部配置;重写此函数以维护内部配置。 更多...
 
virtual double Evaluate (HostDeviceVector< bst_float > const &preds, std::shared_ptr< DMatrix > p_fmat)=0
 使用 DMatrix 作为输入评估指标。 更多...
 
virtual const char * Name () const =0
 
 ~Metric () override=default
 虚析构函数 更多...
 
- 继承自 xgboost::Configurable 的公有成员函数
virtual ~Configurable ()=default
 

静态公有成员函数

static MetricCreate (const std::string &name, Context const *ctx)
 根据名称创建指标。 更多...
 

保护属性

Context const * ctx_ {nullptr}
 

详细描述

用于评估模型性能的评估指标接口。这与训练无关,仅用于评估目的。

构造函数与析构函数文档

◆ ~Metric()

xgboost::Metric::~Metric ( )
重写默认

虚析构函数

成员函数文档

◆ Configure()

virtual void xgboost::Metric::Configure ( const std::vector< std::pair< std::string, std::string > > &  )
内联虚函数

使用指定的参数配置 Metric

参数
args目标函数的参数。

◆ Create()

static Metric* xgboost::Metric::Create ( const std::string &  name,
Context const *  ctx 
)
静态

根据名称创建指标。

参数
name指标的名称。名称可以是 metric[@]param 形式,将在注册表中进行匹配。
ctx全局上下文
返回
创建的指标。

◆ Evaluate()

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

使用 DMatrix 作为输入评估指标。

参数
preds预测结果
p_fmatDMatrix 包含标签等相关信息。

◆ LoadConfig()

void xgboost::Metric::LoadConfig ( Json const &  )
内联重写虚函数

从 JSON 对象加载配置 默认情况下,指标没有内部配置;重写此函数以维护内部配置。

参数
in包含配置的 JSON 对象

实现了 xgboost::Configurable

◆ Name()

virtual const char* xgboost::Metric::Name ( ) const
纯虚函数
返回
指标名称

◆ SaveConfig()

void xgboost::Metric::SaveConfig ( Json p_out) const
内联重写虚函数

将配置保存到 JSON 对象 默认情况下,指标没有内部配置;重写此函数以维护内部配置。

参数
out指向输出 JSON 对象的指针

实现了 xgboost::Configurable

成员数据文档

◆ ctx_

Context const* xgboost::Metric::ctx_ {nullptr}
保护

此类的文档生成自以下文件