LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::uciDataReader Class Reference

Reads data in the form as it is often found in standard data sets: Raw data either just a matrix of doubles with each row a feature vector, or rows containing feature vectors and an id as last element of the row. More...

#include <ltiUciDataReader.h>

Inheritance diagram for lti::uciDataReader:
Inheritance graph
[legend]
Collaboration diagram for lti::uciDataReader:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class uciDataReader More...

Public Member Functions

 uciDataReader ()
 uciDataReader (std::string filename)
 uciDataReader (std::string filename, int nbDimensions, bool bIds=true, bool hasHeader=false)
 uciDataReader (const uciDataReader &other)
virtual ~uciDataReader ()
virtual const char * getTypeName () const
bool apply (dmatrix &data) const
bool apply (dmatrix &data, ivector &ids) const
bool apply (fmatrix &data) const
bool apply (fmatrix &data, ivector &ids) const
uciDataReadercopy (const uciDataReader &other)
uciDataReaderoperator= (const uciDataReader &other)
virtual functorclone () const
const parametersgetParameters () const

Detailed Description

Reads data in the form as it is often found in standard data sets: Raw data either just a matrix of doubles with each row a feature vector, or rows containing feature vectors and an id as last element of the row.

This functor needs the number of dimensions, the existence of ids and the filename as parameters. The according data from that file is returned by the apply method.


Constructor & Destructor Documentation

lti::uciDataReader::uciDataReader (  ) 

default constructor

lti::uciDataReader::uciDataReader ( std::string  filename  ) 

sets the filename

lti::uciDataReader::uciDataReader ( std::string  filename,
int  nbDimensions,
bool  bIds = true,
bool  hasHeader = false 
)

sets the parameters filename, numberOfDimensions and hasIds

lti::uciDataReader::uciDataReader ( const uciDataReader other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::uciDataReader::~uciDataReader (  )  [virtual]

destructor


Member Function Documentation

bool lti::uciDataReader::apply ( fmatrix data,
ivector ids 
) const

Reads data and ids from the file given in the parameters.

If hasIds is false ids is empty.

Parameters:
data the feature vectors
ids ids of the feature vectors
Returns:
true if apply successful or false otherwise.
bool lti::uciDataReader::apply ( fmatrix data  )  const

Reads data from the file given in the parameters.

Parameters:
data the feature vectors
Returns:
true if apply successful or false otherwise.
bool lti::uciDataReader::apply ( dmatrix data,
ivector ids 
) const

Reads data and ids from the file given in the parameters.

If hasIds is false ids is empty.

Parameters:
data the feature vectors
ids ids of the feature vectors
Returns:
true if apply successful or false otherwise.
bool lti::uciDataReader::apply ( dmatrix data  )  const

Reads data from the file given in the parameters.

Parameters:
data the feature vectors
Returns:
true if apply successful or false otherwise.
virtual functor* lti::uciDataReader::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

uciDataReader& lti::uciDataReader::copy ( const uciDataReader other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

const parameters& lti::uciDataReader::getParameters (  )  const

returns used parameters

Reimplemented from lti::ioFunctor.

virtual const char* lti::uciDataReader::getTypeName (  )  const [virtual]

returns the name of this type ("uciDataReader")

Reimplemented from lti::ioFunctor.

uciDataReader& lti::uciDataReader::operator= ( const uciDataReader other  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.


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

Generated on Sat Apr 10 15:28:08 2010 for LTI-Lib by Doxygen 1.6.1