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

This class wraps a set of results for a given query. More...

#include <queryresults.h>

Public Member Functions

 QueryResults (size_t n_results, Label *new_labels, Feature *new_features)
 Allocates an Query Results Object. More...
 
virtual ~QueryResults ()
 
Featurefeatures () const
 
Labellabels () const
 
size_t num_results () const
 
void indexing_of_sorted_labels (const Score *scores, size_t *dest) const
 Sorts the element of the current result list in descending order of the given scores vector and stores in dest the positions of the sorted labels. More...
 
void sorted_labels (const Score *scores, Label *dest, const size_t cutoff) const
 Sorts the element of the current result list in descending order of the given scores vector and stores the resulting sorted labels in dest. More...
 

Private Attributes

Labellabels_
 
Featurefeatures_
 
size_t num_results_
 

Detailed Description

This class wraps a set of results for a given query.

The internal data representation is the same as the Dataset it comes from.

Todo:
TODO: it seems we need also a class withouth features

Constructor & Destructor Documentation

quickrank::data::QueryResults::QueryResults ( size_t  n_results,
quickrank::Label new_labels,
quickrank::Feature new_features 
)

Allocates an Query Results Object.

This is used to store a the set of instances and their labels related to a specific query.

Parameters
n_instancesThe number of training instances (lines) in the dataset.
n_featuresThe number of features.
quickrank::data::QueryResults::~QueryResults ( )
virtual

Member Function Documentation

Feature* quickrank::data::QueryResults::features ( ) const
inline
void quickrank::data::QueryResults::indexing_of_sorted_labels ( const Score scores,
size_t *  dest 
) const

Sorts the element of the current result list in descending order of the given scores vector and stores in dest the positions of the sorted labels.

Parameters
scoresvector of scores used for reverse sorting.
destoutput of the sorting indexing.
Label* quickrank::data::QueryResults::labels ( ) const
inline
size_t quickrank::data::QueryResults::num_results ( ) const
inline
void quickrank::data::QueryResults::sorted_labels ( const Score scores,
Label dest,
const size_t  cutoff 
) const

Sorts the element of the current result list in descending order of the given scores vector and stores the resulting sorted labels in dest.

Parameters
scoresvector of scores used for reverse sorting.
destoutput of the labels sorting.
cutoffnumber of labels of interest, i.e., length of dest.

Member Data Documentation

Feature* quickrank::data::QueryResults::features_
private
Label* quickrank::data::QueryResults::labels_
private
size_t quickrank::data::QueryResults::num_results_
private

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