latest version v1.9 - last update 10 Apr 2010 |
Writes 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, or raw data with or without ids and a header with the number of points and the dimensionality. More...
#include <ltiUciDataWriter.h>
Classes | |
class | parameters |
the parameters for the class uciDataWriter More... | |
Public Member Functions | |
uciDataWriter () | |
uciDataWriter (std::string filename) | |
uciDataWriter (std::string filename, bool bHeader) | |
uciDataWriter (const uciDataWriter &other) | |
virtual | ~uciDataWriter () |
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 |
bool | apply (std::list< dmatrix > &data) const |
bool | apply (std::list< dmatrix > &data, ivector &ids) const |
uciDataWriter & | copy (const uciDataWriter &other) |
uciDataWriter & | operator= (const uciDataWriter &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Writes 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, or raw data with or without ids and a header with the number of points and the dimensionality.
With parameter append it can be choosen if the data if appended to an existing file or if the file should be new created.
If the filename exists and append is false, your data will be lost.
This functor needs the filename and the existence of a header as parameters. With the third parameter you can choose if the data should be appended of if a new file will be created.
lti::uciDataWriter::uciDataWriter | ( | ) |
default constructor
lti::uciDataWriter::uciDataWriter | ( | std::string | filename | ) |
sets the filename
lti::uciDataWriter::uciDataWriter | ( | std::string | filename, | |
bool | bHeader | |||
) |
sets the parameters filename and hasHeader
lti::uciDataWriter::uciDataWriter | ( | const uciDataWriter & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::uciDataWriter::~uciDataWriter | ( | ) | [virtual] |
destructor
Writes data and ids to the file given in the parameters.
The i-th element of ids is the number to which the points in the i-th matrix in data belong to
data | the feature vectors | |
ids | IDs for the elements in data. |
bool lti::uciDataWriter::apply | ( | std::list< dmatrix > & | data | ) | const |
Writes data and ids to the file given in the parameters.
It is suggested that each element of the list is one Cluster
data | the feature vectors |
Writes data and ids to the file given in the parameters.
data | the feature vectors | |
ids | ids of the feature vectors |
bool lti::uciDataWriter::apply | ( | fmatrix & | data | ) | const |
Writes data to the file given in the parameters.
data | the feature vectors |
Writes data and ids to the file given in the parameters.
data | the feature vectors | |
ids | ids of the feature vectors |
bool lti::uciDataWriter::apply | ( | dmatrix & | data | ) | const |
Writes data to the file given in the parameters.
data | the feature vectors |
virtual functor* lti::uciDataWriter::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
uciDataWriter& lti::uciDataWriter::copy | ( | const uciDataWriter & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
const parameters& lti::uciDataWriter::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::ioFunctor.
virtual const char* lti::uciDataWriter::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("uciDataWriter")
Reimplemented from lti::ioFunctor.
uciDataWriter& lti::uciDataWriter::operator= | ( | const uciDataWriter & | other | ) |