Csv.h File Reference
#include <shark/Core/DLLSupport.h>
#include <shark/Data/Dataset.h>
#include <fstream>
#include <string>

Go to the source code of this file.

Namespaces

 shark
 AbstractMultiObjectiveOptimizer.
 
enum  shark::LabelPosition { shark::FIRST_COLUMN, shark::LAST_COLUMN }
 Position of the label in a CSV file. More...
 
SHARK_EXPORT_SYMBOL void shark::csvStringToData (Data< FloatVector > &data, std::string const &contents, char separator=',', char comment='#', std::size_t maximumBatchSize=Data< RealVector >::DefaultBatchSize)
 Import unlabeled vectors from a read-in character-separated value file. More...
 
SHARK_EXPORT_SYMBOL void shark::csvStringToData (Data< RealVector > &data, std::string const &contents, char separator=',', char comment='#', std::size_t maximumBatchSize=Data< RealVector >::DefaultBatchSize)
 Import unlabeled vectors from a read-in character-separated value file. More...
 
SHARK_EXPORT_SYMBOL void shark::csvStringToData (Data< unsigned int > &data, std::string const &contents, char separator=',', char comment='#', std::size_t maximumBatchSize=Data< unsigned int >::DefaultBatchSize)
 Import "csv" from string consisting only of a single unsigned int per row. More...
 
SHARK_EXPORT_SYMBOL void shark::csvStringToData (Data< int > &data, std::string const &contents, char separator=',', char comment='#', std::size_t maximumBatchSize=Data< int >::DefaultBatchSize)
 Import "csv" from string consisting only of a single int per row. More...
 
SHARK_EXPORT_SYMBOL void shark::csvStringToData (Data< float > &data, std::string const &contents, char separator=',', char comment='#', std::size_t maximumBatchSize=Data< double >::DefaultBatchSize)
 Import "csv" from string consisting only of a single double per row. More...
 
SHARK_EXPORT_SYMBOL void shark::csvStringToData (Data< double > &data, std::string const &contents, char separator=',', char comment='#', std::size_t maximumBatchSize=Data< double >::DefaultBatchSize)
 Import "csv" from string consisting only of a single double per row. More...
 
SHARK_EXPORT_SYMBOL void shark::csvStringToData (LabeledData< RealVector, unsigned int > &dataset, std::string const &contents, LabelPosition lp, char separator=',', char comment='#', std::size_t maximumBatchSize=LabeledData< RealVector, unsigned int >::DefaultBatchSize)
 Import labeled data from a character-separated value file. More...
 
SHARK_EXPORT_SYMBOL void shark::csvStringToData (LabeledData< FloatVector, unsigned int > &dataset, std::string const &contents, LabelPosition lp, char separator=',', char comment='#', std::size_t maximumBatchSize=LabeledData< RealVector, unsigned int >::DefaultBatchSize)
 Import labeled data from a character-separated value file. More...
 
SHARK_EXPORT_SYMBOL void shark::csvStringToData (LabeledData< RealVector, RealVector > &dataset, std::string const &contents, LabelPosition lp, std::size_t numberOfOutputs=1, char separator=',', char comment='#', std::size_t maximumBatchSize=LabeledData< RealVector, RealVector >::DefaultBatchSize)
 Import regression data from a read-in character-separated value file. More...
 
SHARK_EXPORT_SYMBOL void shark::csvStringToData (LabeledData< FloatVector, FloatVector > &dataset, std::string const &contents, LabelPosition lp, std::size_t numberOfOutputs=1, char separator=',', char comment='#', std::size_t maximumBatchSize=LabeledData< RealVector, RealVector >::DefaultBatchSize)
 Import regression data from a read-in character-separated value file. More...
 
template<class T >
void shark::importCSV (Data< T > &data, std::string fn, char separator=',', char comment='#', std::size_t maximumBatchSize=Data< T >::DefaultBatchSize, std::size_t titleLines=0)
 Import a Dataset from a csv file. More...
 
template<class T >
void shark::importCSV (LabeledData< blas::vector< T >, unsigned int > &data, std::string fn, LabelPosition lp, char separator=',', char comment='#', std::size_t maximumBatchSize=LabeledData< RealVector, unsigned int >::DefaultBatchSize)
 Import a labeled Dataset from a csv file. More...
 
template<class T >
void shark::importCSV (LabeledData< blas::vector< T >, blas::vector< T > > &data, std::string fn, LabelPosition lp, std::size_t numberOfOutputs=1, char separator=',', char comment='#', std::size_t maximumBatchSize=LabeledData< RealVector, RealVector >::DefaultBatchSize)
 Import a labeled Dataset from a csv file. More...
 
template<typename Type >
void shark::exportCSV (Data< Type > const &set, std::string fn, char separator=',', bool sci=true, unsigned int width=0)
 Format unlabeled data into a character-separated value file. More...
 
template<typename InputType , typename LabelType >
void shark::exportCSV (LabeledData< InputType, LabelType > const &dataset, std::string fn, LabelPosition lp, char separator=',', bool sci=true, unsigned int width=0)
 Format labeled data into a character-separated value file. More...