|
Medial Code Documentation
|
Copyright 2023 by XGBoost contributors. More...
Data Structures | |
| struct | LambdaRankParam |
| class | MAPCache |
| class | NDCGCache |
| class | PreCache |
| class | RankingCache |
| Common cached items for ranking tasks. More... | |
Typedefs | |
| using | rel_degree_t = std::uint32_t |
| Relevance degree. | |
| using | position_t = std::uint32_t |
| top-k position | |
Enumerations | |
| enum class | PairMethod : std::int32_t { kTopK = 0 , kMean = 1 } |
Functions | |
| DMLC_REGISTER_PARAMETER (LambdaRankParam) | |
| std::string | ParseMetricName (StringView name, StringView param, position_t *topn, bool *minus) |
| Parse name for ranking metric given parameters. | |
| std::string | MakeMetricName (StringView name, position_t topn, bool minus) |
| Parse name for ranking metric given parameters. | |
| constexpr std::size_t | MaxRel () |
| Maximum relevance degree for NDCG. | |
| XGBOOST_DEVICE double | CalcDCGGain (rel_degree_t label) |
| XGBOOST_DEVICE double | CalcDCGDiscount (std::size_t idx) |
| XGBOOST_DEVICE double | CalcInvIDCG (double idcg) |
| template<typename NoneOf > | |
| void | CheckNDCGLabels (ltr::LambdaRankParam const &p, linalg::VectorView< float const > labels, NoneOf none_of) |
| Validate label for NDCG. | |
| template<typename AllOf > | |
| bool | IsBinaryRel (linalg::VectorView< float const > label, AllOf all_of) |
| template<typename AllOf > | |
| void | CheckPreLabels (StringView name, linalg::VectorView< float const > label, AllOf all_of) |
| Validate label for precision-based metric. | |
| TEST (RankingUtils, LambdaRankParam) | |
| TEST (RankingUtils, ParseMetricName) | |
| TEST (RankingUtils, MakeMetricName) | |
| void | TestRankingCache (Context const *ctx) |
| TEST (RankingCache, InitFromCPU) | |
| void | TestNDCGCache (Context const *ctx) |
| TEST (NDCGCache, InitFromCPU) | |
| void | TestMAPCache (Context const *ctx) |
| TEST (MAPCache, InitFromCPU) | |
Copyright 2023 by XGBoost contributors.
Copyright 2023 by XGBoost Contributors.
| void xgboost::ltr::CheckNDCGLabels | ( | ltr::LambdaRankParam const & | p, |
| linalg::VectorView< float const > | labels, | ||
| NoneOf | none_of | ||
| ) |
Validate label for NDCG.
| NoneOf | Implementation of std::none_of. Specified as a parameter to reuse the check for both CPU and GPU. |
| void xgboost::ltr::CheckPreLabels | ( | StringView | name, |
| linalg::VectorView< float const > | label, | ||
| AllOf | all_of | ||
| ) |
Validate label for precision-based metric.
| Implementation | of std::all_of. Specified as a parameter to reuse the check for both CPU and GPU. |
| std::string xgboost::ltr::ParseMetricName | ( | StringView | name, |
| StringView | param, | ||
| position_t * | topn, | ||
| bool * | minus | ||
| ) |
Parse name for ranking metric given parameters.
| [in] | name | Null terminated string for metric name |
| [in] | param | Null terminated string for parameter like the 3- in ndcg@3-. |
| [out] | topn | Top n documents parsed from param. Unchanged if it's not specified. |
| [out] | minus | Whether we should turn the score into loss. Unchanged if it's not specified. |