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... | |
Responsible for loading data sets from file or generating random data to use.
|
explicit |
Default Qt-style constructor.
Initializes the random seed for RandomData
| 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
| path | The path to the data file |
| dataset | the DataSet to load into |
| 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.
| numItems | the number of layers to create |
| dataset | the DataSet to write into |
1.8.6