latest version v1.9 - last update 10 Apr 2010 |
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>
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 |
uciDataReader & | copy (const uciDataReader &other) |
uciDataReader & | operator= (const uciDataReader &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
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.
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
other | the object to be copied |
virtual lti::uciDataReader::~uciDataReader | ( | ) | [virtual] |
destructor
Reads data and ids from the file given in the parameters.
If hasIds is false ids
is empty.
data | the feature vectors | |
ids | ids of the feature vectors |
bool lti::uciDataReader::apply | ( | fmatrix & | data | ) | const |
Reads data from the file given in the parameters.
data | the feature vectors |
Reads data and ids from the file given in the parameters.
If hasIds is false ids
is empty.
data | the feature vectors | |
ids | ids of the feature vectors |
bool lti::uciDataReader::apply | ( | dmatrix & | data | ) | const |
Reads data from the file given in the parameters.
data | the feature vectors |
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.
other | the functor to be copied |
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 | ) |