Medial Code Documentation
|
Copyright 2016-2023 by XGBoost Contributors. More...
Namespaces | |
namespace | cuda_impl |
Copyright 2023 by XGBoost Contributors. | |
Data Structures | |
struct | DeviceAUCCache |
struct | EvalAMS |
AMS: also records best threshold. More... | |
class | EvalAUC |
struct | EvalCox |
Cox: Partial likelihood of the Cox proportional hazards model. More... | |
class | EvalMAPScore |
class | EvalNDCG |
Implement the NDCG score function for learning to rank. More... | |
class | EvalPRAUC |
class | EvalPrecision |
struct | EvalRank |
Evaluate rank list. More... | |
struct | EvalRankConfig |
class | EvalRankWithCache |
class | EvalROCAUC |
class | PackedReduceResult |
struct | PRAUCLabelInvalid |
Functions | |
DMLC_REGISTRY_FILE_TAG (auc) | |
template<typename Fn > | |
std::tuple< double, double, double > | BinaryAUC (common::Span< float const > predts, linalg::VectorView< float const > labels, common::OptionalWeights weights, std::vector< size_t > const &sorted_idx, Fn &&area_fn) |
Calculate AUC for binary classification problem. | |
template<typename BinaryAUC > | |
double | MultiClassOVR (Context const *ctx, common::Span< float const > predts, MetaInfo const &info, size_t n_classes, int32_t n_threads, BinaryAUC &&binary_auc) |
Calculate AUC for multi-class classification problem using 1-vs-rest approach. | |
std::tuple< double, double, double > | BinaryROCAUC (Context const *ctx, common::Span< float const > predts, linalg::VectorView< float const > labels, common::OptionalWeights weights) |
double | GroupRankingROC (Context const *ctx, common::Span< float const > predts, linalg::VectorView< float const > labels, float w) |
Calculate AUC for 1 ranking group;. | |
std::tuple< double, double, double > | BinaryPRAUC (Context const *ctx, common::Span< float const > predts, linalg::VectorView< float const > labels, common::OptionalWeights weights) |
PR-AUC for binary classification. | |
template<bool is_roc> | |
std::pair< double, uint32_t > | RankingAUC (Context const *ctx, std::vector< float > const &predts, MetaInfo const &info, int32_t n_threads) |
Cast LTR problem to binary classification problem by comparing pairs. | |
describe ("Receiver Operating Characteristic Area Under the Curve.") .set_body([](const char *) | |
std::tuple< double, double, double > | GPUBinaryROCAUC (common::Span< float const >, MetaInfo const &, std::int32_t, std::shared_ptr< DeviceAUCCache > *) |
double | GPUMultiClassROCAUC (Context const *, common::Span< float const >, MetaInfo const &, std::shared_ptr< DeviceAUCCache > *, std::size_t) |
std::pair< double, std::uint32_t > | GPURankingAUC (Context const *, common::Span< float const >, MetaInfo const &, std::shared_ptr< DeviceAUCCache > *) |
describe ("Area under PR curve for both classification and rank.") .set_body([](char const *) | |
std::tuple< double, double, double > | GPUBinaryPRAUC (common::Span< float const >, MetaInfo const &, std::int32_t, std::shared_ptr< DeviceAUCCache > *) |
double | GPUMultiClassPRAUC (Context const *, common::Span< float const >, MetaInfo const &, std::shared_ptr< DeviceAUCCache > *, std::size_t) |
std::pair< double, std::uint32_t > | GPURankingPRAUC (Context const *, common::Span< float const >, MetaInfo const &, std::shared_ptr< DeviceAUCCache > *) |
XGBOOST_DEVICE double | TrapezoidArea (double x0, double x1, double y0, double y1) |
void | InvalidGroupAUC () |
void | InvalidLabels () |
DMLC_REGISTRY_LINK_TAG (auc) | |
DMLC_REGISTRY_LINK_TAG (elementwise_metric) | |
DMLC_REGISTRY_LINK_TAG (multiclass_metric) | |
DMLC_REGISTRY_LINK_TAG (survival_metric) | |
DMLC_REGISTRY_LINK_TAG (rank_metric) | |
DMLC_REGISTRY_FILE_TAG (rank_metric) | |
describe ("AMS metric for higgs.") .set_body([](const char *param) | |
describe ("Negative log partial likelihood of Cox proportional hazards model.") .set_body([](const char *) | |
describe ("precision@k for rank.") .set_body([](const char *param) | |
describe ("map@k for ranking.") .set_body([](char const *param) | |
describe ("ndcg@k for ranking.") .set_body([](char const *param) | |
TEST (Metric, DeclareUnifiedTest(BinaryAUC)) | |
TEST (Metric, DeclareUnifiedTest(MultiClassAUC)) | |
TEST (Metric, DeclareUnifiedTest(RankingAUC)) | |
TEST (Metric, DeclareUnifiedTest(PRAUC)) | |
TEST (Metric, DeclareUnifiedTest(MultiClassPRAUC)) | |
TEST (Metric, DeclareUnifiedTest(RankingPRAUC)) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), BinaryAUCRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), BinaryAUCColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MultiClassAUCRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MultiClassAUCColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), RankingAUCRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), RankingAUCColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), PRAUCRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), PRAUCColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MultiClassPRAUCRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MultiClassPRAUCColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), RankingPRAUCRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), RankingPRAUCColumnSplit) | |
void | VerifyBinaryAUC (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyMultiClassAUC (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyRankingAUC (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyPRAUC (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyMultiClassPRAUC (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyRankingPRAUC (DataSplitMode data_split_mode=DataSplitMode::kRow) |
TEST (Metric, DeclareUnifiedTest(RMSE)) | |
TEST (Metric, DeclareUnifiedTest(RMSLE)) | |
TEST (Metric, DeclareUnifiedTest(MAE)) | |
TEST (Metric, DeclareUnifiedTest(MAPE)) | |
TEST (Metric, DeclareUnifiedTest(MPHE)) | |
TEST (Metric, DeclareUnifiedTest(LogLoss)) | |
TEST (Metric, DeclareUnifiedTest(Error)) | |
TEST (Metric, DeclareUnifiedTest(PoissonNegLogLik)) | |
TEST (Metric, DeclareUnifiedTest(MultiRMSE)) | |
TEST (Metric, DeclareUnifiedTest(Quantile)) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), RMSERowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), RMSEColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), RMSLERowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), RMSLEColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MAERowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MAEColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MAPERowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MAPEColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MPHERowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MPHEColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), LogLossRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), LogLossColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), ErrorRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), ErrorColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), PoissonNegLogLikRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), PoissonNegLogLikColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MultiRMSERowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MultiRMSEColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), QuantileRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), QuantileColumnSplit) | |
void | CheckDeterministicMetricElementWise (StringView name, int32_t device) |
void | VerifyRMSE (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyRMSLE (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyMAE (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyMAPE (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyMPHE (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyLogLoss (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyError (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyPoissonNegLogLik (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyMultiRMSE (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyQuantile (DataSplitMode data_split_mode=DataSplitMode::kRow) |
TEST (Metric, DeclareUnifiedTest(MultiClassError)) | |
TEST (Metric, DeclareUnifiedTest(MultiClassLogLoss)) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MultiClassErrorRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MultiClassErrorColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MultiClassLogLossRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MultiClassLogLossColumnSplit) | |
void | CheckDeterministicMetricMultiClass (StringView name, int32_t device) |
void | TestMultiClassError (int device, DataSplitMode data_split_mode) |
void | VerifyMultiClassError (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | TestMultiClassLogLoss (int device, DataSplitMode data_split_mode) |
void | VerifyMultiClassLogLoss (DataSplitMode data_split_mode=DataSplitMode::kRow) |
TEST (Metric, AMS) | |
TEST (Metric, DeclareUnifiedTest(Precision)) | |
TEST (Metric, DeclareUnifiedTest(NDCG)) | |
TEST (Metric, DeclareUnifiedTest(MAP)) | |
TEST (Metric, DeclareUnifiedTest(NDCGExpGain)) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), PrecisionRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), PrecisionColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), NDCGRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), NDCGColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MAPRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), MAPColumnSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), NDCGExpGainRowSplit) | |
TEST_F (DeclareUnifiedDistributedTest(MetricTest), NDCGExpGainColumnSplit) | |
void | VerifyPrecision (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyNDCG (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyMAP (DataSplitMode data_split_mode=DataSplitMode::kRow) |
void | VerifyNDCGExpGain (DataSplitMode data_split_mode=DataSplitMode::kRow) |
TEST_F (FederatedMetricTest, BinaryAUCRowSplit) | |
TEST_F (FederatedMetricTest, BinaryAUCColumnSplit) | |
TEST_F (FederatedMetricTest, MultiClassAUCRowSplit) | |
TEST_F (FederatedMetricTest, MultiClassAUCColumnSplit) | |
TEST_F (FederatedMetricTest, RankingAUCRowSplit) | |
TEST_F (FederatedMetricTest, RankingAUCColumnSplit) | |
TEST_F (FederatedMetricTest, PRAUCRowSplit) | |
TEST_F (FederatedMetricTest, PRAUCColumnSplit) | |
TEST_F (FederatedMetricTest, MultiClassPRAUCRowSplit) | |
TEST_F (FederatedMetricTest, MultiClassPRAUCColumnSplit) | |
TEST_F (FederatedMetricTest, RankingPRAUCRowSplit) | |
TEST_F (FederatedMetricTest, RankingPRAUCColumnSplit) | |
TEST_F (FederatedMetricTest, RMSERowSplit) | |
TEST_F (FederatedMetricTest, RMSEColumnSplit) | |
TEST_F (FederatedMetricTest, RMSLERowSplit) | |
TEST_F (FederatedMetricTest, RMSLEColumnSplit) | |
TEST_F (FederatedMetricTest, MAERowSplit) | |
TEST_F (FederatedMetricTest, MAEColumnSplit) | |
TEST_F (FederatedMetricTest, MAPERowSplit) | |
TEST_F (FederatedMetricTest, MAPEColumnSplit) | |
TEST_F (FederatedMetricTest, MPHERowSplit) | |
TEST_F (FederatedMetricTest, MPHEColumnSplit) | |
TEST_F (FederatedMetricTest, LogLossRowSplit) | |
TEST_F (FederatedMetricTest, LogLossColumnSplit) | |
TEST_F (FederatedMetricTest, ErrorRowSplit) | |
TEST_F (FederatedMetricTest, ErrorColumnSplit) | |
TEST_F (FederatedMetricTest, PoissonNegLogLikRowSplit) | |
TEST_F (FederatedMetricTest, PoissonNegLogLikColumnSplit) | |
TEST_F (FederatedMetricTest, MultiRMSERowSplit) | |
TEST_F (FederatedMetricTest, MultiRMSEColumnSplit) | |
TEST_F (FederatedMetricTest, QuantileRowSplit) | |
TEST_F (FederatedMetricTest, QuantileColumnSplit) | |
TEST_F (FederatedMetricTest, MultiClassErrorRowSplit) | |
TEST_F (FederatedMetricTest, MultiClassErrorColumnSplit) | |
TEST_F (FederatedMetricTest, MultiClassLogLossRowSplit) | |
TEST_F (FederatedMetricTest, MultiClassLogLossColumnSplit) | |
TEST_F (FederatedMetricTest, PrecisionRowSplit) | |
TEST_F (FederatedMetricTest, PrecisionColumnSplit) | |
TEST_F (FederatedMetricTest, NDCGRowSplit) | |
TEST_F (FederatedMetricTest, NDCGColumnSplit) | |
TEST_F (FederatedMetricTest, MAPRowSplit) | |
TEST_F (FederatedMetricTest, MAPColumnSplit) | |
TEST_F (FederatedMetricTest, NDCGExpGainRowSplit) | |
TEST_F (FederatedMetricTest, NDCGExpGainColumnSplit) | |
Copyright 2016-2023 by XGBoost Contributors.
std::tuple< double, double, double > xgboost::metric::BinaryAUC | ( | common::Span< float const > | predts, |
linalg::VectorView< float const > | labels, | ||
common::OptionalWeights | weights, | ||
std::vector< size_t > const & | sorted_idx, | ||
Fn && | area_fn | ||
) |
Calculate AUC for binary classification problem.
This function does not normalize the AUC by 1 / (num_positive * num_negative), instead it returns a tuple for caller to handle the normalization.
std::tuple< double, double, double > xgboost::metric::BinaryPRAUC | ( | Context const * | ctx, |
common::Span< float const > | predts, | ||
linalg::VectorView< float const > | labels, | ||
common::OptionalWeights | weights | ||
) |
PR-AUC for binary classification.
double xgboost::metric::MultiClassOVR | ( | Context const * | ctx, |
common::Span< float const > | predts, | ||
MetaInfo const & | info, | ||
size_t | n_classes, | ||
int32_t | n_threads, | ||
BinaryAUC && | binary_auc | ||
) |
Calculate AUC for multi-class classification problem using 1-vs-rest approach.
TODO(jiaming): Use better algorithms like: