yat  0.14.5pre
Public Member Functions | List of all members
theplu::yat::classifier::ConsensusInputRanker Class Reference

Robust algorithm to rank rows in a data matrix versus a target vector. More...

#include <yat/classifier/ConsensusInputRanker.h>

Public Member Functions

 ConsensusInputRanker (const IRRetrieve &, const statistics::VectorFunction &)
 Default constructor. More...
 
void add (const Sampler &sampler, const MatrixLookup &, const statistics::Score &s)
 
void add (const Sampler &sampler, const MatrixLookupWeighted &data, const statistics::Score &score)
 Add a set of InputRankers. More...
 
void add (const InputRanker &ir)
 Add an InputRanker. More...
 
size_t id (size_t i) const
 
const InputRankerinput_ranker (size_t i) const
 
size_t rank (size_t i) const
 
void reserve (size_t n)
 reserve memory for internal vector of InputRankers More...
 
void update (void)
 

Detailed Description

Robust algorithm to rank rows in a data matrix versus a target vector.

The idea is to create several (different) ranked lists. The list could be different because they are based upon different sub-sets of the data, or the different lists could be different because they have been generated using different criteria. Having $ N $ lists means each row in the data matrix has $ N $ ranks (each corresponding to one list). A statistics::VectorFunction is used to boil down these ranks to one consensus rank, and a ranked list is created by sorting the data rows with respect to this consensus rank.

For the time being there are two ways to build a ConsensusInputRanker. 1) Sending a Sampler and a MatrixLookup to the add function will create one ranked list for each of the partitions defined in the Sampler. 2) You can generate your ranked list outside, using your favourite method, and adding it into the ConsensusInputRanker object. This allows combining different scores and different sub-sets in a more general way.

Constructor & Destructor Documentation

theplu::yat::classifier::ConsensusInputRanker::ConsensusInputRanker ( const IRRetrieve ,
const statistics::VectorFunction  
)

Default constructor.

Truly does nothing but creates a few empty member vectors.

Member Function Documentation

void theplu::yat::classifier::ConsensusInputRanker::add ( const Sampler sampler,
const MatrixLookup ,
const statistics::Score s 
)

Iterating through sampler creating subsets of data, and for each subset is an InputRanker is created using the score. After creation the data rows are sorted with respect to the median rank (i.e. update() is called).

void theplu::yat::classifier::ConsensusInputRanker::add ( const Sampler sampler,
const MatrixLookupWeighted data,
const statistics::Score score 
)

Add a set of InputRankers.

Iterating through sampler creating subsets of data, and for each subset is an InputRanker is created using the score. After creation the data rows are sorted with respect to the median rank (i.e. update() is called).

void theplu::yat::classifier::ConsensusInputRanker::add ( const InputRanker ir)

Add an InputRanker.

Note
update() must be called to make the added InputRanker to influence consensus ids and ranks. If a sequence of InputRankers are added, update() need to be called only after the last InputRanker is added.
size_t theplu::yat::classifier::ConsensusInputRanker::id ( size_t  i) const

Row with lowest rank (highest score) is ranked as number zero

Returns
index of row ranked as number i
const InputRanker& theplu::yat::classifier::ConsensusInputRanker::input_ranker ( size_t  i) const
Returns
ith InputRanker
size_t theplu::yat::classifier::ConsensusInputRanker::rank ( size_t  i) const

Row with lowest rank (highest score) is ranked as number zero

Returns
rank for row i
void theplu::yat::classifier::ConsensusInputRanker::reserve ( size_t  n)

reserve memory for internal vector of InputRankers

This function is recommended before adding using add(const InputRanker&) to avoid re-allocations.

void theplu::yat::classifier::ConsensusInputRanker::update ( void  )

update ids and ranks


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

Generated on Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5