QuickRank  v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
low_weights_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 LowWeightsPruning: public Cleaver {
33 
34  public:
35  LowWeightsPruning(double pruning_rate) : Cleaver(pruning_rate) { };
36 
37  LowWeightsPruning(double pruning_rate,
38  std::shared_ptr<learning::linear::LineSearch> lineSearch) :
39  Cleaver(pruning_rate, lineSearch) { };
40 
41  LowWeightsPruning(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
void pruning(std::set< unsigned int > &pruned_estimators, std::shared_ptr< data::Dataset > dataset, std::shared_ptr< metric::ir::Metric > scorer)
Definition: low_weights_pruning.cc:41
Cleaver::PruningMethod pruning_method() const
Returns the pruning method of the algorithm.
Definition: low_weights_pruning.cc:33
This implements random pruning strategy for pruning ensembles.
Definition: low_weights_pruning.h:32
LowWeightsPruning(const pugi::xml_document &model)
Definition: low_weights_pruning.h:41
LowWeightsPruning(double pruning_rate, std::shared_ptr< learning::linear::LineSearch > lineSearch)
Definition: low_weights_pruning.h:37
LowWeightsPruning(double pruning_rate)
Definition: low_weights_pruning.h:35
bool line_search_pre_pruning() const
Definition: low_weights_pruning.cc:37
This implements various strategies for pruning ensembles.
Definition: cleaver.h:44