SG++
sgpp::datadriven::CSVTools Class Reference

Class that provides functionality to read CSV files. More...

#include <CSVTools.hpp>

Static Public Member Functions

static Dataset readCSV (const std::string &filename, bool skipFirstLine=false)
 Reads an CSV file. More...
 
static void readCSVSize (const std::string &filename, size_t &numberInstances, size_t &dimension)
 Reads the size of an CSV file. More...
 

Detailed Description

Class that provides functionality to read CSV files.

Member Function Documentation

Dataset sgpp::datadriven::CSVTools::readCSV ( const std::string &  filename,
bool  skipFirstLine = false 
)
static

Reads an CSV file.

Parameters
filenamefilename of the file to be read
skipFirstLinewhether to skip the first line while parsing
Returns
CSV as Dataset

References dataset, sgpp::datadriven::Dataset::getData(), sgpp::datadriven::Dataset::getTargets(), and readCSVSize().

Referenced by sgpp::datadriven::CSVFileSampleProvider::readFile().

void sgpp::datadriven::CSVTools::readCSVSize ( const std::string &  filename,
size_t &  numberInstances,
size_t &  dimension 
)
static

Reads the size of an CSV file.

Parameters
filenamefilename of the file to be read
[out]numberInstancesnumber of instances in the dataset
[out]dimensionnumber of dimensions in the dataset

References python.leja::count, sgpp::base::DataMatrix::getNcols(), sgpp::base::DataVector::set(), and sgpp::base::DataMatrix::set().

Referenced by readCSV().


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