52 Dataset(
size_t n_instances,
size_t n_features);
97 std::vector<Feature> i_features);
136 virtual std::ostream &
put(std::ostream &os)
const;
size_t offset(size_t i) const
Returns the offset in the internal data structure of the i-th query results list. ...
Definition: dataset.h:80
Definition: dataset.cc:28
size_t last_instance_id_
Definition: dataset.h:126
std::unique_ptr< QueryResults > getQueryResults(size_t i) const
Returns the i-th QueryResults in the dataset.
Definition: dataset.cc:89
Dataset & operator=(const Dataset &)=delete
Avoid inefficient copy assignment.
size_t max_instances_
Definition: dataset.h:127
This class implements a Dataset to be used for a L-t-R task.
Definition: dataset.h:45
virtual ~Dataset()
Definition: dataset.cc:57
quickrank::Feature * at(size_t document_id, size_t feature_id)
Returns a pointer to a specific data item.
Definition: dataset.h:65
size_t num_features_
Definition: dataset.h:118
Label getLabel(size_t document_id)
Returns the value of the i-th relevance label.
Definition: dataset.h:70
float Feature
data type for instance predicted label
Definition: types.h:31
quickrank::Feature * data_
Definition: dataset.h:122
std::vector< size_t > offsets_
Definition: dataset.h:124
size_t num_instances_
Definition: dataset.h:120
unsigned int QueryID
data type for instance feature
Definition: types.h:32
size_t num_queries() const
Returns the number of queries in the dataset.
Definition: dataset.h:104
size_t num_queries_
Definition: dataset.h:119
friend std::ostream & operator<<(std::ostream &os, const Dataset &me)
The output stream operator.
Definition: dataset.h:131
void addInstance(QueryID q_id, Label i_label, std::vector< Feature > i_features)
Add a new training instance, i.e., a labeled document, to the dataset.
Definition: dataset.cc:64
Dataset(size_t n_instances, size_t n_features)
Allocates an empty Dataset of given size in horizontal format.
Definition: dataset.cc:31
size_t num_instances() const
Returns the number of documents in the dataset.
Definition: dataset.h:108
quickrank::Label * labels_
Definition: dataset.h:123
size_t num_features() const
Returns the number of features used to represent a document.
Definition: dataset.h:100
virtual std::ostream & put(std::ostream &os) const
Prints the data reading time stats.
Definition: dataset.cc:99
float Label
Definition: types.h:29