QuickRank  v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
quality_loss_pruning.h
Go to the documentation of this file.
1 /*
2  * QuickRank - A C++ suite of Learning to Rank algorithms
3  * Webpage: http://quickrank.isti.cnr.it/
4  * Contact: quickrank@isti.cnr.it
5  *
6  * Unless explicitly acquired and licensed from Licensor under another
7  * license, the contents of this file are subject to the Reciprocal Public
8  * License ("RPL") Version 1.5, or subsequent versions as allowed by the RPL,
9  * and You may not copy or use this file in either source code or executable
10  * form, except in compliance with the terms and conditions of the RPL.
11  *
12  * All software distributed under the RPL is provided strictly on an "AS
13  * IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND
14  * LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
15  * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16  * PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the RPL for specific
17  * language governing rights and limitations under the RPL.
18  *
19  * Contributors:
20  * - Salvatore Trani(salvatore.trani@isti.cnr.it)
21  */
22 #pragma once
23 
25 
26 namespace quickrank {
27 namespace optimization {
28 namespace post_learning {
29 namespace pruning {
30 
31 /// This implements random pruning strategy for pruning ensembles.
32 class QualityLossPruning: public Cleaver {
33 
34  public:
35  QualityLossPruning(double pruning_rate) : Cleaver(pruning_rate) { };
36 
37  QualityLossPruning(double pruning_rate,
38  std::shared_ptr<learning::linear::LineSearch> lineSearch) :
39  Cleaver(pruning_rate, lineSearch) { };
40 
41  QualityLossPruning(const pugi::xml_document &model) :
42  Cleaver(model) { };
43 
45 
46  bool line_search_pre_pruning() const;
47 
48  void pruning(std::set<unsigned int> &pruned_estimators,
49  std::shared_ptr<data::Dataset> dataset,
50  std::shared_ptr<metric::ir::Metric> scorer);
51 };
52 
53 } // namespace pruning
54 } // namespace post_learning
55 } // namespace optimization
56 } // namespace quickrank
Definition: dataset.cc:28
bool line_search_pre_pruning() const
Definition: quality_loss_pruning.cc:37
QualityLossPruning(const pugi::xml_document &model)
Definition: quality_loss_pruning.h:41
QualityLossPruning(double pruning_rate)
Definition: quality_loss_pruning.h:35
QualityLossPruning(double pruning_rate, std::shared_ptr< learning::linear::LineSearch > lineSearch)
Definition: quality_loss_pruning.h:37
void pruning(std::set< unsigned int > &pruned_estimators, std::shared_ptr< data::Dataset > dataset, std::shared_ptr< metric::ir::Metric > scorer)
Definition: quality_loss_pruning.cc:41
Cleaver::PruningMethod pruning_method() const
Returns the pruning method of the algorithm.
Definition: quality_loss_pruning.cc:33
This implements random pruning strategy for pruning ensembles.
Definition: quality_loss_pruning.h:32
This implements various strategies for pruning ensembles.
Definition: cleaver.h:44