View Class Reference

A view object defines a subset of a labeled data set, and is made up of one or more ‘orderings’, which are sets of indices into the data set. More...

#include <View.h>

Inherits NamedObject.

Inheritance diagram for View:

Inheritance graph
[legend]
Collaboration diagram for View:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 View (const char *name, Data *d)
 Creates an empty View object, associated with the passed Data set.
 View (const char *name, Data *d, int numToGen)
 Creates a View object associated with a particular data set, and generates random orderings of the full data set.
void addOrdering (OrderedSubset *os)
 Adds a specified ordering to the view.
void genOrderings (int numToAdd)
 Given a View object with at least a single ordering defined, will generate a specified number of permutations of the first orderings.
int getNumOrderings ()
 Accessor method.
DatagetData ()
 Accessor method.
OrderedSubsetgetOrdering (int i)
 Returns the specified ordering.
void list (ostream &s, int i)
 Generates a space-separated list of the entries in a particular ordering of the View.
void hist (ostream &s, int i)
 Generates a histogram of the classes in the View.

Detailed Description

A view object defines a subset of a labeled data set, and is made up of one or more ‘orderings’, which are sets of indices into the data set.

Learning in some classifiers, ARTMAP networks in particular, are sensitive to the order of presentation of samples. By storing multiple orderings of a subset of data within a View object, Classer can train multiple copies of a particular classifier, each with a different ordering of the subset. Orderings may be automatically generated within Classer, or passed from text files if specific orderings are desired. If an ordering is file-based, it is just a set of integer indices into the data set (i.e., line numbers, starting at 1), one per line.


Constructor & Destructor Documentation

View::View const char *  name,
Data d
 

Creates an empty View object, associated with the passed Data set.

Parameters:
name The name by which to refer to the object in logged messages.
d The data set object with which to associate the View.

View::View const char *  name,
Data d,
int  numToGen
 

Creates a View object associated with a particular data set, and generates random orderings of the full data set.

Parameters:
name The name by which to refer to the object in logged messages.
d The data set object with which to associate the View.
numToGen The number of orderings to generate. If numToGen = -1, only a single, in-order ordering is generated, otherwise the specified number of orderings are generated, each random.


Member Function Documentation

void View::addOrdering OrderedSubset os  ) 
 

Adds a specified ordering to the view.

Parameters:
os The OrderedSubset object defining the ordering.

void View::genOrderings int  numToAdd  ) 
 

Given a View object with at least a single ordering defined, will generate a specified number of permutations of the first orderings.

This lets the user control which subset of the data is used, but lets Classer handle permuting the set.

Parameters:
numToAdd Number of permutations to add to the View. These are permutations of the first ordering.
Exceptions:
MsgException If numToAdd <= 0.

Data* View::getData  )  [inline]
 

Accessor method.

Returns:
A pointer to the data set this View refers to.

int View::getNumOrderings  )  [inline]
 

Accessor method.

Returns:
The number of stored orderings

OrderedSubset * View::getOrdering int  i  ) 
 

Returns the specified ordering.

Parameters:
i Index of the specified ordering
Exceptions:
MsgException If index is invalid

void View::hist ostream &  s,
int  orderingIdx
 

Generates a histogram of the classes in the View.

This is also available for the data set as a whole, but this call can be used if the View is a subset smaller than the whole data set. Also, the call applies to a specified ordering of the View at a time.

Parameters:
s The output stream to send the histogram to.
orderingIdx Which of the View's orderings to base the histogram on.

void View::list ostream &  s,
int  orderingIdx
 

Generates a space-separated list of the entries in a particular ordering of the View.

Parameters:
s Output stream to receive the list.
orderingIdx The ordering to use.


The documentation for this class was generated from the following files:
Generated on Tue Dec 13 11:00:27 2005 for Classer by  doxygen 1.4.3