QuickRank  v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
quickrank::learning::forests::ObliviousMart Class Reference

#include <obliviousmart.h>

Inheritance diagram for quickrank::learning::forests::ObliviousMart:
quickrank::learning::forests::Mart quickrank::learning::LTR_Algorithm

Public Member Functions

 ObliviousMart (size_t ntrees, double shrinkage, size_t nthresholds, size_t treedepth, size_t minleafsupport, size_t esr)
 Initializes a new ObliviousLambdaMart instance with the given learning parameters. More...
 
 ObliviousMart (const pugi::xml_document &model)
 
virtual ~ObliviousMart ()
 
virtual std::string name () const
 Returns the name of the ranker. More...
 
- Public Member Functions inherited from quickrank::learning::forests::Mart
 Mart (size_t ntrees, double shrinkage, size_t nthresholds, size_t ntreeleaves, size_t minleafsupport, size_t valid_iterations)
 Initializes a new Mart instance with the given learning parameters. More...
 
 Mart (const pugi::xml_document &model)
 Generates a LTR_Algorithm instance from a previously saved XML model. More...
 
virtual ~Mart ()
 
virtual void learn (std::shared_ptr< data::Dataset > training_dataset, std::shared_ptr< data::Dataset > validation_dataset, std::shared_ptr< metric::ir::Metric > training_metric, size_t partial_save, const std::string output_basename)
 Start the learning process. More...
 
virtual Score score_document (const Feature *d) const
 Returns the score by the current ranker. More...
 
virtual std::shared_ptr< std::vector< Score > > partial_scores_document (const Feature *d) const
 Returns the partial scores of a given document, tree. More...
 
virtual void print_additional_stats (void) const
 Print additional statistics. More...
 
virtual bool update_weights (std::shared_ptr< std::vector< double >> weights)
 Update the weights for the ensemble models (only). More...
 
virtual std::shared_ptr< std::vector< double > > get_weights () const
 Return the weights for the ensemble models (only). More...
 
- Public Member Functions inherited from quickrank::learning::LTR_Algorithm
 LTR_Algorithm ()
 
 LTR_Algorithm (const pugi::xml_document &model)
 Generates a LTR_Algorithm instance from a previously saved XML model. More...
 
virtual ~LTR_Algorithm ()
 
 LTR_Algorithm (const LTR_Algorithm &other)=delete
 Avoid inefficient copy constructor. More...
 
LTR_Algorithmoperator= (const LTR_Algorithm &)=delete
 Avoid inefficient copy assignment. More...
 
virtual void score_dataset (std::shared_ptr< data::Dataset > dataset, Score *scores) const
 Given and input dateset, the current ranker generates scores for each instance and store the in the scores vector. More...
 
virtual void save (std::string model_filename, int suffix=-1) const
 Save the current model to the output_file. More...
 

Static Public Attributes

static const std::string NAME_ = "OBVMART"
 
- Static Public Attributes inherited from quickrank::learning::forests::Mart
static const std::string NAME_ = "MART"
 

Protected Member Functions

virtual std::unique_ptr< RegressionTreefit_regressor_on_gradient (std::shared_ptr< data::VerticalDataset > training_dataset)
 Fits a regression tree on the gradient given by the pseudo residuals. More...
 
virtual pugi::xml_document * get_xml_model () const
 Return the xml model representing the current object. More...
 
- Protected Member Functions inherited from quickrank::learning::forests::Mart
virtual void init (std::shared_ptr< data::VerticalDataset > training_dataset)
 Prepares private data structures before training takes place. More...
 
virtual void clear (size_t num_features)
 De-allocates private data structure after training has taken place. More...
 
virtual void compute_pseudoresponses (std::shared_ptr< data::VerticalDataset > training_dataset, metric::ir::Metric *metric)
 Computes pseudo responses. More...
 
virtual void update_modelscores (std::shared_ptr< data::Dataset > dataset, Score *scores, RegressionTree *tree)
 Updates scores with the last learnt regression tree. More...
 
virtual void update_modelscores (std::shared_ptr< data::VerticalDataset > dataset, Score *scores, RegressionTree *tree)
 

Protected Attributes

size_t treedepth_
 
- Protected Attributes inherited from quickrank::learning::forests::Mart
float ** thresholds_ = NULL
 
size_t * thresholds_size_ = NULL
 
double * scores_on_training_ = NULL
 
quickrank::Scorescores_on_validation_ = NULL
 
size_t validation_bestmodel_ = 0
 
double * pseudoresponses_ = NULL
 
Ensemble ensemble_model_
 
size_t ntrees_
 
double shrinkage_
 
size_t nthresholds_
 
size_t nleaves_
 
size_t minleafsupport_
 
size_t valid_iterations_
 
size_t ** sortedsid_ = NULL
 
size_t sortedsize_ = 0
 
RTRootHistogramhist_ = NULL
 

Private Member Functions

virtual std::ostream & put (std::ostream &os) const
 Prints the description of Algorithm, including its parameters. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const ObliviousMart &a)
 The output stream operator. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from quickrank::learning::LTR_Algorithm
static std::shared_ptr< LTR_Algorithmload_model_from_file (std::string model_filename)
 Load a model from a given XML file. More...
 

Constructor & Destructor Documentation

quickrank::learning::forests::ObliviousMart::ObliviousMart ( size_t  ntrees,
double  shrinkage,
size_t  nthresholds,
size_t  treedepth,
size_t  minleafsupport,
size_t  esr 
)
inline

Initializes a new ObliviousLambdaMart instance with the given learning parameters.

Parameters
ntreesMaximum number of trees.
shrinkageLearning rate.
nthresholdsNumber of bins in discretization. 0 means no discretization.
treedepthMaximum depth of each tree.
minleafsupportMinimum number of instances in each leaf.
esrEarly stopping if no improvement after iterations on the validation set.
quickrank::learning::forests::ObliviousMart::ObliviousMart ( const pugi::xml_document &  model)
virtual quickrank::learning::forests::ObliviousMart::~ObliviousMart ( )
inlinevirtual

Member Function Documentation

std::unique_ptr< RegressionTree > quickrank::learning::forests::ObliviousMart::fit_regressor_on_gradient ( std::shared_ptr< data::VerticalDataset training_dataset)
protectedvirtual

Fits a regression tree on the gradient given by the pseudo residuals.

Parameters
training_datasetThe dataset used for training

Reimplemented from quickrank::learning::forests::Mart.

pugi::xml_document * quickrank::learning::forests::ObliviousMart::get_xml_model ( ) const
protectedvirtual

Return the xml model representing the current object.

Reimplemented from quickrank::learning::forests::Mart.

virtual std::string quickrank::learning::forests::ObliviousMart::name ( ) const
inlinevirtual

Returns the name of the ranker.

Reimplemented from quickrank::learning::forests::Mart.

std::ostream & quickrank::learning::forests::ObliviousMart::put ( std::ostream &  os) const
privatevirtual

Prints the description of Algorithm, including its parameters.

Reimplemented from quickrank::learning::forests::Mart.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ObliviousMart a 
)
friend

The output stream operator.

Member Data Documentation

const std::string quickrank::learning::forests::ObliviousMart::NAME_ = "OBVMART"
static
size_t quickrank::learning::forests::ObliviousMart::treedepth_
protected

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