44 double reduction_factor,
unsigned int max_iterations,
45 unsigned int max_failed_vali);
52 virtual std::string
name()
const {
65 virtual void learn(std::shared_ptr<data::Dataset> training_dataset,
66 std::shared_ptr<data::Dataset> validation_dataset,
67 std::shared_ptr<metric::ir::Metric> metric,
69 const std::string model_filename);
78 virtual std::shared_ptr<std::vector<double>>
get_weights()
const {
80 return std::shared_ptr<std::vector<double>>(
84 virtual bool update_weights(std::shared_ptr<std::vector<double>> weights);
101 virtual std::ostream &
put(std::ostream &os)
const;
Definition: dataset.cc:28
CoordinateAscent(unsigned int num_points, double window_size, double reduction_factor, unsigned int max_iterations, unsigned int max_failed_vali)
Definition: coordinate_ascent.cc:56
virtual Score score_document(const Feature *d) const
Returns the score of a given document.
Definition: coordinate_ascent.cc:250
virtual bool update_weights(std::shared_ptr< std::vector< double >> weights)
Update the weights for the ensemble models (only).
Definition: coordinate_ascent.cc:258
double reduction_factor_
Definition: coordinate_ascent.h:91
friend std::ostream & operator<<(std::ostream &os, const CoordinateAscent &a)
The output stream operator.
Definition: coordinate_ascent.h:96
Definition: ltr_algorithm.h:33
unsigned int max_iterations_
Definition: coordinate_ascent.h:92
float Feature
data type for instance predicted label
Definition: types.h:31
virtual std::shared_ptr< std::vector< double > > get_weights() const
Returns the learned weights.
Definition: coordinate_ascent.h:78
std::vector< double > best_weights_
Definition: coordinate_ascent.h:87
static const std::string NAME_
Definition: coordinate_ascent.h:56
unsigned int max_failed_vali_
Definition: coordinate_ascent.h:93
double Score
data type for instance truth label
Definition: types.h:30
virtual void learn(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)
Executes the learning process.
Definition: coordinate_ascent.cc:116
virtual pugi::xml_document * get_xml_model() const
Return the xml model representing the current object.
Definition: coordinate_ascent.cc:271
virtual ~CoordinateAscent()
Definition: coordinate_ascent.cc:102
unsigned int num_samples_
Definition: coordinate_ascent.h:89
double window_size_
Definition: coordinate_ascent.h:90
virtual std::ostream & put(std::ostream &os) const
Prints the description of Algorithm, including its parameters.
Definition: coordinate_ascent.cc:105
virtual std::string name() const
Returns the name of the ranker.
Definition: coordinate_ascent.h:52
This implements the Coordinate Ascent algorithm.
Definition: coordinate_ascent.h:40