QuickRank  v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
Public Member Functions | Static Public Member Functions | Static Private Member Functions | List of all members
quickrank::driver::Driver Class Reference

This class implements the main logic of the quickrank application. More...

#include <driver.h>

Public Member Functions

 Driver ()
 
virtual ~Driver ()
 

Static Public Member Functions

static int run (ParamsMap &pmap)
 Implements the main logic of the quickrank application, detecting the metrics to adopt and the phases to execute (train/validation/test). More...
 

Static Private Member Functions

static void training_phase (std::shared_ptr< learning::LTR_Algorithm > algo, std::shared_ptr< metric::ir::Metric > train_metric, std::shared_ptr< quickrank::data::Dataset > training_dataset, std::shared_ptr< quickrank::data::Dataset > validation_dataset, const std::string output_filename, const size_t npartialsave)
 Runs train/validation of algo by optimizing train_metric and then measures test_metric on the test data. More...
 
static void optimization_phase (std::shared_ptr< quickrank::optimization::Optimization > opt_algorithm, std::shared_ptr< learning::LTR_Algorithm > ranking_algo, std::shared_ptr< metric::ir::Metric > train_metric, std::shared_ptr< quickrank::data::Dataset > training_dataset, std::shared_ptr< quickrank::data::Dataset > validation_dataset, std::string training_partial_filename, std::string validation_partial_filename, const std::string output_filename, const std::string opt_algo_model_filename, const size_t npartialsave)
 Runs train/validation of algo by optimizing train_metric and then measures test_metric on the test data. More...
 
static void testing_phase (std::shared_ptr< learning::LTR_Algorithm > algo, std::shared_ptr< metric::ir::Metric > test_metric, std::shared_ptr< quickrank::data::Dataset > test_dataset, const std::string scores_filename, const bool detailed_testing)
 Runs the learned or loaded model on the test data and then measures test_metric on the test data. More...
 
static std::shared_ptr< quickrank::data::Datasetload_dataset (const std::string dataset_filename, const std::string dataset_label)
 
static std::shared_ptr< data::Datasetextract_partial_scores (std::shared_ptr< learning::LTR_Algorithm > algo, std::shared_ptr< data::Dataset > input_dataset)
 

Detailed Description

This class implements the main logic of the quickrank application.

Constructor & Destructor Documentation

quickrank::driver::Driver::Driver ( )
quickrank::driver::Driver::~Driver ( )
virtual

Member Function Documentation

std::shared_ptr< data::Dataset > quickrank::driver::Driver::extract_partial_scores ( std::shared_ptr< learning::LTR_Algorithm algo,
std::shared_ptr< data::Dataset input_dataset 
)
staticprivate
std::shared_ptr< quickrank::data::Dataset > quickrank::driver::Driver::load_dataset ( const std::string  dataset_filename,
const std::string  dataset_label 
)
staticprivate
void quickrank::driver::Driver::optimization_phase ( std::shared_ptr< quickrank::optimization::Optimization opt_algorithm,
std::shared_ptr< learning::LTR_Algorithm ranking_algo,
std::shared_ptr< metric::ir::Metric train_metric,
std::shared_ptr< quickrank::data::Dataset training_dataset,
std::shared_ptr< quickrank::data::Dataset validation_dataset,
std::string  training_partial_filename,
std::string  validation_partial_filename,
const std::string  output_filename,
const std::string  opt_algo_model_filename,
const size_t  npartialsave 
)
staticprivate

Runs train/validation of algo by optimizing train_metric and then measures test_metric on the test data.

Parameters
algoThe L-T-R algorithm to be tested.
train_metricThe metric optimized during training.
training_filenameThe training dataset.
validation_filenameThe validation dataset. If empty, validation is not used.
output_filenameModel output file. If empty, no output file is written.
npartialsaveAllows to save a partial model every given number of iterations.
int quickrank::driver::Driver::run ( ParamsMap &  pmap)
static

Implements the main logic of the quickrank application, detecting the metrics to adopt and the phases to execute (train/validation/test).

Returns the exit code of the application

Parameters
void quickrank::driver::Driver::testing_phase ( std::shared_ptr< learning::LTR_Algorithm algo,
std::shared_ptr< metric::ir::Metric test_metric,
std::shared_ptr< quickrank::data::Dataset test_dataset,
const std::string  scores_filename,
const bool  detailed_testing 
)
staticprivate

Runs the learned or loaded model on the test data and then measures test_metric on the test data.

Parameters
algoThe L-T-R algorithm to be tested.
test_metricThe metric measured on the test data.
test_filenameThe test dataset. If empty, no performance is measured on the test set.
scores_filenameThe output scores file. If set save the scores computed for the test set.
verboseIf True saves an SVML-like file with the score of each ranker in the ensemble. NB. Works only for ensembles.
void quickrank::driver::Driver::training_phase ( std::shared_ptr< learning::LTR_Algorithm algo,
std::shared_ptr< metric::ir::Metric train_metric,
std::shared_ptr< quickrank::data::Dataset training_dataset,
std::shared_ptr< quickrank::data::Dataset validation_dataset,
const std::string  output_filename,
const size_t  npartialsave 
)
staticprivate

Runs train/validation of algo by optimizing train_metric and then measures test_metric on the test data.

Parameters
algoThe L-T-R algorithm to be tested.
train_metricThe metric optimized during training.
training_filenameThe training dataset.
validation_filenameThe validation dataset. If empty, validation is not used.
output_filenameModel output file. If empty, no output file is written.
npartialsaveAllows to save a partial model every given number of iterations.

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