79 std::ostream &
put(std::ostream &os)
const {
80 os <<
"# WeakRanker " << feature_id_ <<
":" << theta_ <<
" (" <<
")" 96 Rankboost(
const pugi::xml_document &model);
106 virtual std::string
name()
const {
120 std::shared_ptr<data::Dataset> training_dataset,
121 std::shared_ptr<data::Dataset> validation_dataset,
122 std::shared_ptr<metric::ir::Metric> metric,
124 const std::string model_filename);
131 virtual std::shared_ptr<std::vector<Score>> partial_scores_document(
135 virtual pugi::xml_document *get_xml_model()
const;
137 virtual bool update_weights(std::vector<double> &weights);
139 virtual std::shared_ptr<std::vector<double>> get_weights()
const;
145 unsigned int *n_theta = NULL;
146 unsigned int ***SDF = NULL;
154 float *alphas = NULL;
156 float max_alpha = 0.0;
160 void init(std::shared_ptr<data::Dataset> training_dataset,
161 std::shared_ptr<data::Dataset> validation_dataset);
162 void compute_pi(std::shared_ptr<data::Dataset> dataset);
163 WeakRanker *compute_weak_ranker(std::shared_ptr<data::Dataset> dataset);
165 (std::shared_ptr<data::Dataset> dataset,
WeakRanker *wr,
float alpha);
166 MetricScore compute_metric_score(std::shared_ptr<data::Dataset> dataset,
167 std::shared_ptr<quickrank::metric::ir::Metric> scorer);
168 void clean(std::shared_ptr<data::Dataset> dataset);
178 virtual std::ostream &
put(std::ostream &os)
const;
Definition: dataset.cc:28
int get_sign() const
Definition: rankboost.h:56
unsigned int feature_id_
Definition: rankboost.h:71
virtual std::ostream & put(std::ostream &os) const
Prints the description of Algorithm, including its parameters.
Definition: rankboost.cc:96
This implements the RankBoost algorithm.
Definition: rankboost.h:92
Definition: ltr_algorithm.h:33
float Feature
data type for instance predicted label
Definition: types.h:31
Feature theta_
Definition: rankboost.h:72
size_t T
Definition: rankboost.h:149
unsigned int score_document(const quickrank::Feature *d)
Definition: rankboost.h:60
size_t best_T
Definition: rankboost.h:150
Feature get_theta() const
Definition: rankboost.h:52
static const std::string NAME_
Definition: rankboost.h:110
double Score
data type for instance truth label
Definition: types.h:30
virtual std::string name() const
Returns the name of the ranker.
Definition: rankboost.h:106
char const * omp_schedule
Definition: rankboost.h:152
~WeakRanker()
Definition: rankboost.h:45
Definition: rankboost.h:36
unsigned int get_feature_id() const
Definition: rankboost.h:48
std::ostream & put(std::ostream &os) const
Definition: rankboost.h:79
WeakRanker * clone()
Definition: rankboost.h:66
WeakRanker(unsigned int feature_id, Feature theta, int sign)
Definition: rankboost.h:39
friend std::ostream & operator<<(std::ostream &os, const Rankboost &a)
The output stream operator.
Definition: rankboost.h:173
int sign_
Definition: rankboost.h:73
bool go_parallel
Definition: rankboost.h:151
double MetricScore
data type for QueryID in L-t-R datasets
Definition: types.h:33
friend std::ostream & operator<<(std::ostream &os, const WeakRanker &a)
Definition: rankboost.h:75