This class implements a Dataset to be used for a L-t-R task.
More...
#include <vertical_dataset.h>
|
virtual std::ostream & | put (std::ostream &os) const |
| Prints the data reading time stats. More...
|
|
This class implements a Dataset to be used for a L-t-R task.
The internal representation is vertical: a row vector of size num_instances() x num_features(). (A training instance is indeed a document.) We allow to directly access the internal representation through the function at() to support fast access and custom high performance implementations. Representation is vertical, i.e., a matrix features x documents.
quickrank::data::VerticalDataset::VerticalDataset |
( |
std::shared_ptr< Dataset > |
h_dataset | ) |
|
Allocates a vertical dataset by copying and transposing an horizontal one.
- Parameters
-
h_dataset | The horizontal dataset. |
quickrank::data::VerticalDataset::~VerticalDataset |
( |
| ) |
|
|
virtual |
quickrank::data::VerticalDataset::VerticalDataset |
( |
const VerticalDataset & |
other | ) |
|
|
delete |
Avoid inefficient copy constructor.
quickrank::Feature* quickrank::data::VerticalDataset::at |
( |
size_t |
document_id, |
|
|
size_t |
feature_id |
|
) |
| |
|
inline |
Returns a pointer to a specific data item.
- Parameters
-
document_id | The document of interest. |
feature_id | The feature of interest. |
- Returns
- A reference to the requested feature value of the given document id.
Label quickrank::data::VerticalDataset::getLabel |
( |
size_t |
document_id | ) |
|
|
inline |
Returns the value of the i-th relevance label.
std::unique_ptr< QueryResults > quickrank::data::VerticalDataset::getQueryResults |
( |
size_t |
i | ) |
const |
Returns the i-th QueryResults in the dataset.
- Parameters
-
i | The i-th query results list of interest. |
- Returns
- The requested QueryResults.
unsigned int quickrank::data::VerticalDataset::num_features |
( |
| ) |
const |
|
inline |
Returns the number of features used to represent a document.
unsigned int quickrank::data::VerticalDataset::num_instances |
( |
| ) |
const |
|
inline |
Returns the number of documents in the dataset.
unsigned int quickrank::data::VerticalDataset::num_queries |
( |
| ) |
const |
|
inline |
Returns the number of queries in the dataset.
unsigned int quickrank::data::VerticalDataset::offset |
( |
size_t |
i | ) |
const |
|
inline |
Returns the offset in the internal data strcutures of the i-th query results list.
- Parameters
-
i | The i-th query results list of interest. |
- Returns
- The offset of the first document in the i-th query results list. This can be used to later invoke the at() function.
Avoid inefficient copy assignment.
std::ostream & quickrank::data::VerticalDataset::put |
( |
std::ostream & |
os | ) |
const |
|
privatevirtual |
Prints the data reading time stats.
The output stream operator.
Prints the data reading time stats
size_t quickrank::data::VerticalDataset::num_features_ |
|
private |
size_t quickrank::data::VerticalDataset::num_instances_ |
|
private |
size_t quickrank::data::VerticalDataset::num_queries_ |
|
private |
std::vector<size_t> quickrank::data::VerticalDataset::offsets_ |
|
private |
The documentation for this class was generated from the following files: