QuickRank  v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
Public Member Functions | List of all members
quickrank::optimization::post_learning::pruning::ScoreLossPruning Class Reference

This implements random pruning strategy for pruning ensembles. More...

#include <score_loss_pruning.h>

Inheritance diagram for quickrank::optimization::post_learning::pruning::ScoreLossPruning:
quickrank::optimization::post_learning::pruning::Cleaver quickrank::optimization::post_learning::PostLearningOptimization quickrank::optimization::Optimization

Public Member Functions

 ScoreLossPruning (double pruning_rate)
 
 ScoreLossPruning (double pruning_rate, std::shared_ptr< learning::linear::LineSearch > lineSearch)
 
 ScoreLossPruning (const pugi::xml_document &model)
 
Cleaver::PruningMethod pruning_method () const
 Returns the pruning method of the algorithm. More...
 
bool line_search_pre_pruning () const
 
void pruning (std::set< unsigned int > &pruned_estimators, std::shared_ptr< data::Dataset > dataset, std::shared_ptr< metric::ir::Metric > scorer)
 
- Public Member Functions inherited from quickrank::optimization::post_learning::pruning::Cleaver
 Cleaver (double pruning_rate)
 
 Cleaver (double pruning_rate, std::shared_ptr< learning::linear::LineSearch > lineSearch)
 
 Cleaver (const pugi::xml_document &model)
 
std::string name () const
 Returns the name of the optimizer. More...
 
virtual bool need_partial_score_dataset () const
 
void optimize (std::shared_ptr< quickrank::learning::LTR_Algorithm > algo, std::shared_ptr< quickrank::data::Dataset > training_dataset, std::shared_ptr< quickrank::data::Dataset > validation_dataset, std::shared_ptr< quickrank::metric::ir::Metric > metric, size_t partial_save, const std::string model_filename)
 
virtual std::shared_ptr< data::Datasetfilter_dataset (std::shared_ptr< data::Dataset > dataset, std::set< unsigned int > &pruned_estimators) const
 Process the dataset filtering out features with 0-weight. More...
 
virtual pugi::xml_document * get_xml_model () const
 Return the xml model representing the current object. More...
 
virtual std::vector< float > & get_weigths ()
 Returns the learned weights. More...
 
- Public Member Functions inherited from quickrank::optimization::post_learning::PostLearningOptimization
bool is_pre_learning () const
 
- Public Member Functions inherited from quickrank::optimization::Optimization
 Optimization ()
 
 Optimization (const pugi::xml_document &model)
 Generates a LTR_Algorithm instance from a previously saved XML model. More...
 
virtual ~Optimization ()=default
 
 Optimization (const Optimization &other)=delete
 Avoid inefficient copy constructor. More...
 
Optimizationoperator= (const Optimization &)=delete
 Avoid inefficient copy assignment. More...
 
virtual void optimize (std::shared_ptr< learning::LTR_Algorithm > algo, std::shared_ptr< data::Dataset > training_dataset, std::shared_ptr< data::Dataset > validation_dataset, std::shared_ptr< metric::ir::Metric > metric, size_t partial_save, const std::string model_filename)=0
 Executes the optimization process. More...
 
virtual void save (std::string model_filename, int suffix=-1) const
 Save the current model to the output_file. More...
 

Additional Inherited Members

- Public Types inherited from quickrank::optimization::post_learning::pruning::Cleaver
enum  PruningMethod {
  PruningMethod::RANDOM, PruningMethod::LOW_WEIGHTS, PruningMethod::SKIP, PruningMethod::LAST,
  PruningMethod::QUALITY_LOSS, PruningMethod::SCORE_LOSS
}
 
- Public Types inherited from quickrank::optimization::Optimization
enum  OptimizationAlgorithm { OptimizationAlgorithm::EPRUNING }
 
- Static Public Member Functions inherited from quickrank::optimization::post_learning::pruning::Cleaver
static PruningMethod getPruningMethod (std::string name)
 
static std::string getPruningMethod (PruningMethod pruningMethod)
 
- Static Public Member Functions inherited from quickrank::optimization::Optimization
static std::shared_ptr< Optimizationload_model_from_file (std::string model_filename)
 Load a model from a given XML file. More...
 
static OptimizationAlgorithm getOptimizationAlgorithm (std::string name)
 
static std::string getPruningMethod (OptimizationAlgorithm optAlgo)
 
- Static Public Attributes inherited from quickrank::optimization::post_learning::pruning::Cleaver
static const std::vector< std::string > pruningMethodNames
 
static const std::string NAME_ = "CLEAVER"
 
- Static Public Attributes inherited from quickrank::optimization::Optimization
static const std::vector< std::string > optimizationAlgorithmNames
 
- Protected Member Functions inherited from quickrank::optimization::post_learning::pruning::Cleaver
std::ostream & put (std::ostream &os) const
 Prints the description of Algorithm, including its parameters. More...
 
virtual void score (data::Dataset *dataset, Score *scores) const
 
virtual void import_weights_from_line_search (std::set< unsigned int > &pruned_estimators)
 
- Protected Attributes inherited from quickrank::optimization::post_learning::pruning::Cleaver
double pruning_rate_
 
unsigned int estimators_to_prune_
 
unsigned int estimators_to_select_
 
std::shared_ptr< learning::linear::LineSearchlineSearch_
 
std::vector< float > weights_
 

Detailed Description

This implements random pruning strategy for pruning ensembles.

Constructor & Destructor Documentation

quickrank::optimization::post_learning::pruning::ScoreLossPruning::ScoreLossPruning ( double  pruning_rate)
inline
quickrank::optimization::post_learning::pruning::ScoreLossPruning::ScoreLossPruning ( double  pruning_rate,
std::shared_ptr< learning::linear::LineSearch lineSearch 
)
inline
quickrank::optimization::post_learning::pruning::ScoreLossPruning::ScoreLossPruning ( const pugi::xml_document &  model)
inline

Member Function Documentation

bool quickrank::optimization::post_learning::pruning::ScoreLossPruning::line_search_pre_pruning ( ) const
virtual
void quickrank::optimization::post_learning::pruning::ScoreLossPruning::pruning ( std::set< unsigned int > &  pruned_estimators,
std::shared_ptr< data::Dataset dataset,
std::shared_ptr< metric::ir::Metric scorer 
)
virtual
Cleaver::PruningMethod quickrank::optimization::post_learning::pruning::ScoreLossPruning::pruning_method ( ) const
virtual

Returns the pruning method of the algorithm.

Implements quickrank::optimization::post_learning::pruning::Cleaver.


The documentation for this class was generated from the following files: