Unverified Commit b305a432 authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

fixed cpplint issues and updated docs (#2830)

parent 83012fe4
......@@ -39,7 +39,7 @@ LambdaRank
- Use ``label_gain`` to set the gain(weight) of ``int`` label.
- Use ``max_position`` to set the NDCG optimization position.
- Use ``lambdarank_truncation_level`` to truncate the max DCG.
Cost Efficient Gradient Boosting
--------------------------------
......
......@@ -99,9 +99,9 @@ Core Parameters
- ``lambdarank``, `lambdarank <https://papers.nips.cc/paper/2971-learning-to-rank-with-nonsmooth-cost-functions.pdf>`__ objective. `label_gain <#label_gain>`__ can be used to set the gain (weight) of ``int`` label and all values in ``label`` must be smaller than number of elements in ``label_gain``
- ``rank_xendcg``, `XE_NDCG_MART <https://arxiv.org/abs/1911.09798>`__ ranking objective function. aliases: ``xendcg``, ``xe_ndcg``, ``xe_ndcg_mart``, ``xendcg_mart``.
- ``rank_xendcg``, `XE_NDCG_MART <https://arxiv.org/abs/1911.09798>`__ ranking objective function, aliases: ``xendcg``, ``xe_ndcg``, ``xe_ndcg_mart``, ``xendcg_mart``
- ``rank_xendcg`` is faster than ``lambdarank`` and achieves the similar performance as ``lambdarank``
- ``rank_xendcg`` is faster than and achieves the similar performance as ``lambdarank``
- label should be ``int`` type, and larger number represents the higher relevance (e.g. 0:bad, 1:fair, 2:good, 3:perfect)
......@@ -805,9 +805,9 @@ Objective Parameters
- ``objective_seed`` :raw-html:`<a id="objective_seed" title="Permalink to this parameter" href="#objective_seed">&#x1F517;&#xFE0E;</a>`, default = ``5``, type = int
- random seed for objectives, if random process is needed
- used only in ``rank_xendcg`` objective
- used in ``rank_xendcg``
- random seed for objectives, if random process is needed
- ``num_class`` :raw-html:`<a id="num_class" title="Permalink to this parameter" href="#num_class">&#x1F517;&#xFE0E;</a>`, default = ``1``, type = int, aliases: ``num_classes``, constraints: ``num_class > 0``
......@@ -885,7 +885,7 @@ Objective Parameters
- used only in ``lambdarank`` application
- used for truncating the max_ndcg, refer to "truncation level" in the Sec.3 of `LambdaMART paper <https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/MSR-TR-2010-82.pdf>`__ .
- used for truncating the max DCG, refer to "truncation level" in the Sec. 3 of `LambdaMART paper <https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/MSR-TR-2010-82.pdf>`__
- ``lambdarank_norm`` :raw-html:`<a id="lambdarank_norm" title="Permalink to this parameter" href="#lambdarank_norm">&#x1F517;&#xFE0E;</a>`, default = ``true``, type = bool
......
......@@ -128,8 +128,8 @@ struct Config {
// descl2 = label is anything in interval [0, 1]
// desc = ranking application
// descl2 = ``lambdarank``, `lambdarank <https://papers.nips.cc/paper/2971-learning-to-rank-with-nonsmooth-cost-functions.pdf>`__ objective. `label_gain <#label_gain>`__ can be used to set the gain (weight) of ``int`` label and all values in ``label`` must be smaller than number of elements in ``label_gain``
// descl2 = ``rank_xendcg``, `XE_NDCG_MART <https://arxiv.org/abs/1911.09798>`__ ranking objective function. aliases: ``xendcg``, ``xe_ndcg``, ``xe_ndcg_mart``, ``xendcg_mart``.
// descl2 = ``rank_xendcg`` is faster than ``lambdarank`` and achieves the similar performance as ``lambdarank``
// descl2 = ``rank_xendcg``, `XE_NDCG_MART <https://arxiv.org/abs/1911.09798>`__ ranking objective function, aliases: ``xendcg``, ``xe_ndcg``, ``xe_ndcg_mart``, ``xendcg_mart``
// descl2 = ``rank_xendcg`` is faster than and achieves the similar performance as ``lambdarank``
// descl2 = label should be ``int`` type, and larger number represents the higher relevance (e.g. 0:bad, 1:fair, 2:good, 3:perfect)
std::string objective = "regression";
......@@ -706,8 +706,8 @@ struct Config {
#pragma region Objective Parameters
// desc = used only in ``rank_xendcg`` objective
// desc = random seed for objectives, if random process is needed
// desc = used in ``rank_xendcg``
int objective_seed = 5;
// check = >0
......@@ -768,7 +768,7 @@ struct Config {
// check = >0
// desc = used only in ``lambdarank`` application
// desc = used for truncating the max_ndcg, refer to "truncation level" in the Sec.3 of `LambdaMART paper <https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/MSR-TR-2010-82.pdf>`__ .
// desc = used for truncating the max DCG, refer to "truncation level" in the Sec. 3 of `LambdaMART paper <https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/MSR-TR-2010-82.pdf>`__
int lambdarank_truncation_level = 20;
// desc = used only in ``lambdarank`` application
......
......@@ -725,7 +725,7 @@ namespace LightGBM {
return new MultiValSparseBin<size_t, uint32_t>(
num_data, num_bin, estimate_element_per_row);
}
}
}
}
} // namespace LightGBM
......@@ -69,7 +69,7 @@ class RankingObjective : public ObjectiveFunction {
const double* score, score_t* lambdas,
score_t* hessians) const = 0;
virtual const char* GetName() const override = 0;
const char* GetName() const override = 0;
std::string ToString() const override {
std::stringstream str_buf;
......@@ -91,6 +91,7 @@ class RankingObjective : public ObjectiveFunction {
/*! \brief Query boundries */
const data_size_t* query_boundaries_;
};
/*!
* \brief Objective function for Lambdrank with NDCG
*/
......@@ -262,12 +263,13 @@ class LambdarankNDCG : public RankingObjective {
double sigmoid_;
/*! \brief Normalize the lambdas or not */
bool norm_;
/*! \brief truncation position for max ndcg */
/*! \brief Truncation position for max DCG */
int truncation_level_;
/*! \brief Cache inverse max DCG, speed up calculation */
std::vector<double> inverse_max_dcgs_;
/*! \brief Cache result for sigmoid transform to speed up */
std::vector<double> sigmoid_table_;
/*! \brief Gains for labels */
std::vector<double> label_gain_;
/*! \brief Number of bins in simoid table */
size_t _sigmoid_bins = 1024 * 1024;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment