ETHSelector Class Reference

#include <eth-selector.h>

Inheritance diagram for ETHSelector:

ExampleSelector List of all members.

Detailed Description

(Experiment-specific) Picks examples for a test on ETH-80.


Public Member Functions

 ETHSelector (const vector< int > &labels, int which_test)
vector< LabeledIndexGetTrainingExamples ()
 Returns a vector of LabeledIndices of training instances sorted by index.
vector< LabeledIndexGetTestingExamples ()
 Returns a vector of LabeledIndices of testing instances sorted by index.
vector< int > GetUniqueLabels ()
 Returns a vector containing all the unique labels seen. Sorting is NOT guaranteed.
int GetNumExamples () const
 Returns the total number of examples there are.

Protected Member Functions

virtual void SelectExamples ()
 Responsible for calling AddTrainingExample and AddTestingExample to generate the lists.
const vector< LabeledIndex > & GetExamples () const
 Get all of the examples (in the same order as given when constructed).
vector< LabeledIndexInvertSelection (const vector< LabeledIndex > &selection) const
 Returns all instances are NOT in <selection>.
vector< LabeledIndexInvertSelection (const vector< LabeledIndex > &selection, const vector< LabeledIndex > &superset) const
 Returns all instances in <superset> that are NOT in <selection>.
vector< LabeledIndexRandomSample (int n, const vector< LabeledIndex > &selection) const
 Return a random sample of size <n> of <selection>.
vector< LabeledIndexGetInstancesWithLabel (int label, const vector< LabeledIndex > &selection) const
 Gets all elements in <selection> with the given <label>.
void AddTrainingExample (LabeledIndex index)
 Add a LabeledIndex to the list of designated training examples.
void AddTestingExample (LabeledIndex index)
 Add a LabeledIndex to the list of designated testing examples.


Constructor & Destructor Documentation

ETHSelector ( const vector< int > &  labels,
int  which_test 
)

There are 80 different tests to run. The one you want is specified by <which_test>. The test involves including all 5 images (viewpoints) of one object as testing examples, and everything else as training. There are 80 objects, so there are 80 different tests to run.


Member Function Documentation

void SelectExamples (  )  [protected, virtual]

Responsible for calling AddTrainingExample and AddTestingExample to generate the lists.

Implements ExampleSelector.

vector< LabeledIndex > GetTrainingExamples (  )  [inherited]

Returns a vector of LabeledIndices of training instances sorted by index.

vector< LabeledIndex > GetTestingExamples (  )  [inherited]

Returns a vector of LabeledIndices of testing instances sorted by index.

vector< int > GetUniqueLabels (  )  [inherited]

Returns a vector containing all the unique labels seen. Sorting is NOT guaranteed.

int GetNumExamples (  )  const [inherited]

Returns the total number of examples there are.

const vector< LabeledIndex > & GetExamples (  )  const [protected, inherited]

Get all of the examples (in the same order as given when constructed).

vector< LabeledIndex > InvertSelection ( const vector< LabeledIndex > &  selection  )  const [protected, inherited]

Returns all instances are NOT in <selection>.

<selection> must be sorted by index. The output will be sorted by index.

vector< LabeledIndex > InvertSelection ( const vector< LabeledIndex > &  selection,
const vector< LabeledIndex > &  superset 
) const [protected, inherited]

Returns all instances in <superset> that are NOT in <selection>.

<selection> and <superset> must be sorted by index. The output will be sorted by index.

vector< LabeledIndex > RandomSample ( int  n,
const vector< LabeledIndex > &  selection 
) const [protected, inherited]

Return a random sample of size <n> of <selection>.

<selection> must be sorted by index. If the size of <selection> is less than n, this function will return a vector of size selection.size(). Output is sorted by index.

vector< LabeledIndex > GetInstancesWithLabel ( int  label,
const vector< LabeledIndex > &  selection 
) const [protected, inherited]

Gets all elements in <selection> with the given <label>.

<selection> must be sorted. The output will be sorted.

void AddTrainingExample ( LabeledIndex  index  )  [protected, inherited]

Add a LabeledIndex to the list of designated training examples.

void AddTestingExample ( LabeledIndex  index  )  [protected, inherited]

Add a LabeledIndex to the list of designated testing examples.


The documentation for this class was generated from the following files:
Generated on Fri Sep 21 11:39:06 2007 for libpmk2 by  doxygen 1.5.1