Stacked Graphs
Geometry & Aesthetics
 All Classes Functions Variables Enumerations
Public Member Functions | List of all members
DataLoader Class Reference

Responsible for loading data sets from file or generating random data to use. More...

#include <fileloader.h>

Public Member Functions

 DataLoader (QObject *parent=0)
 Default Qt-style constructor. More...
 
bool LoadData (const QString &path, DataSet &dataset) const
 Loads a data set from the specified file path. More...
 
void RandomData (int numItems, DataSet &dataset) const
 Generates a random dataset of numItems layers. More...
 

Detailed Description

Responsible for loading data sets from file or generating random data to use.

Constructor & Destructor Documentation

DataLoader::DataLoader ( QObject *  parent = 0)
explicit

Default Qt-style constructor.

Initializes the random seed for RandomData

Member Function Documentation

bool DataLoader::LoadData ( const QString &  path,
DataSet dataset 
) const

Loads a data set from the specified file path.

The file format is basically a CSV, with tuples of (label,data) entries. Each row is an element of the time series (usually month, etc). The first line of the file has to be the string #STACKED

Parameters
pathThe path to the data file
datasetthe DataSet to load into
Returns
true if loading succeeded, false on error
void DataLoader::RandomData ( int  numItems,
DataSet dataset 
) const

Generates a random dataset of numItems layers.

It will have a time series of length 12. The dataset is created by randomly placing some gaussian curves on each layer.

Parameters
numItemsthe number of layers to create
datasetthe DataSet to write into

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