#include <ArffFileSink.h>
Inherits Marsyas::MarSystem.
Public Member Functions | |
| ArffFileSink (const ArffFileSink &a) | |
| ArffFileSink copy constructor. | |
| ArffFileSink (std::string name) | |
| ArffFileSink constructor. | |
| MarSystem * | clone () const |
| Implementation of the MarSystem::clone() method. | |
| void | myProcess (realvec &in, realvec &out) |
| Implementation of the MarSystem::myProcess method. | |
| ~ArffFileSink () | |
| ArffFileSink destructor. | |
Private Member Functions | |
| void | addControls () |
| Add specific controls needed by this MarSystem. | |
| void | closeOutput () |
| Helper function for closing the output (if needed). | |
| void | myUpdate (MarControlPtr sender) |
| Reads changed controls and sets up variables if necessary. | |
| void | prepareOutput () |
| Preparation of the output stream (open file, write header if necessary). | |
| void | writeArffHeader () |
| Write ARFF header. | |
Private Attributes | |
| MarControlPtr | ctrl_decimationFactor_ |
| MarControl for setting the decimation factor for the data writing. | |
| MarControlPtr | ctrl_filename_ |
| MarControl for setting the filename of the file to write to. | |
| MarControlPtr | ctrl_floatPrecision_ |
| MarControl for setting the floating point precision. | |
| mrs_natural | decimationCounter |
| Internal counter for handling the decimation. | |
| mrs_natural | decimationFactor_ |
| Local cache of the decimation factor for data writing. | |
| mrs_string | filename_ |
| Name of the file we are writing to. | |
| mrs_natural | floatPrecision_ |
| Local cache for the decimal precision to use in the floating point notation. | |
| std::ofstream * | os_ |
| The output stream to write the WEKA ARFF data to. | |
ArffFileSink writes the input realvec data it receives to a file in ARFF format (Attribute-Relation File Format). The ARFF format is relatively easy and consists of a simple header, describing the observation channels (called 'attributes' in ARFF), and a straightforward data body.
ARFF files are typically used with the Weka machine learning software.
ArffFileSink is basically a simple rewrite of WekaSink. The problem with WekaSink is that it contains a fair amount of assumptions about the usage and purpose of the generated Weka files, which limits the flexibility of WekaSink. Fixing this in WekaSink without breaking backwards compatibility would be very hard and messy.
Definition at line 55 of file ArffFileSink.h.
| ArffFileSink | ( | const ArffFileSink & | a | ) |
ArffFileSink copy constructor.
All member MarControlPtr have to be explicitly reassigned in the copy constructor.
Definition at line 44 of file ArffFileSink.cpp.
References ArffFileSink::ctrl_decimationFactor_, ArffFileSink::ctrl_filename_, ArffFileSink::ctrl_floatPrecision_, ArffFileSink::decimationCounter, ArffFileSink::filename_, and ArffFileSink::os_.
| void addControls | ( | ) | [private] |
Add specific controls needed by this MarSystem.
Add any specific controls needed by this MarSystem.
Reimplemented from MarSystem.
Definition at line 70 of file ArffFileSink.cpp.
References ArffFileSink::ctrl_decimationFactor_, ArffFileSink::ctrl_filename_, and ArffFileSink::ctrl_floatPrecision_.
Referenced by ArffFileSink::ArffFileSink().
| void myUpdate | ( | MarControlPtr | sender | ) | [private, virtual] |
Reads changed controls and sets up variables if necessary.
Use the default MarSystem setup with equal input/output stream format.
Reimplemented from MarSystem.
Definition at line 79 of file ArffFileSink.cpp.
References ArffFileSink::ctrl_decimationFactor_, ArffFileSink::ctrl_floatPrecision_, ArffFileSink::decimationCounter, ArffFileSink::decimationFactor_, and ArffFileSink::floatPrecision_.
| void prepareOutput | ( | ) | [private] |
Preparation of the output stream (open file, write header if necessary).
Prepare the output stream: open file and write header if needed.
Definition at line 109 of file ArffFileSink.cpp.
References ArffFileSink::closeOutput(), ArffFileSink::ctrl_filename_, ArffFileSink::filename_, ArffFileSink::os_, and ArffFileSink::writeArffHeader().
Referenced by ArffFileSink::myProcess().
1.5.6