#include <Dataset.h>
Public Member Functions | |
| Dataset (const Dataset &dataset) | |
| Construction of a Dataset from another Dataset. | |
| Dataset (DataSource &source, int train, int test) | |
| Construction of a Dataset from a generic DataSource. | |
| Dataset (const char *filename, int train, int test=0) | |
| Construction of a Dataset from a single file. | |
| Dataset (const char *filename, double train) | |
| Construction of a Dataset from a single file. | |
| Dataset (const char *trainfile, const char *testfile) | |
| Construction of a Dataset from a pair of files. | |
| Dataset (const char *trainfile, const char *testfile, int train) | |
| Construction of a Dataset from a pair of files, but using a different data separation into training and test set. | |
| Dataset (const char *datafile, const char *splitfile, double disambiguation) | |
| Construction of a Dataset from a data file and a split file. | |
| Dataset (const Array< double > &trainingData, const Array< double > &trainingTarget, const Array< double > &testData, const Array< double > &testTarget) | |
| Construction of a Dataset object from given arrays. | |
| void | ShuffleTraining () |
| shuffles the training examples | |
| void | ShuffleTest () |
| shuffles the test examples | |
| void | ShuffleAll () |
| shuffles the union of training and test examples, such that the number of training and test examples remains unchanged | |
| const Array< double > & | getTrainingData () const |
| access to the training data as a constant array | |
| const Array< double > & | getTrainingTarget () const |
| access to the training targets as a constant array | |
| const Array< double > & | getTestData () const |
| access to the test data as a constant array | |
| const Array< double > & | getTestTarget () const |
| access to the test targets as a constant array | |
| bool | Save (const char *filename, bool training=true, bool test=true, const char *format="ascii") |
| Save the current Dataset to a file. | |
| bool | SaveLIBSVM (const char *filename, bool training=true, bool test=true) |
| Save the current Dataset in LIBSVM format. | |
| void | NormalizeComponents () |
| component wise normalization of the dataset | |
Protected Member Functions | |
| bool | ReadSplitFile (const char *filename, std::vector< unsigned int > &train, std::vector< unsigned int > &test) |
| bool | ReadLine (FILE *file, char *buffer, int bufferlength) |
Protected Attributes | |
| Array< double > | trainingData |
| Array< double > | trainingTarget |
| Array< double > | testData |
| Array< double > | testTarget |
CrossValidation.cpp, KernelOptimization.cpp, KM.cpp, KNN.cpp, LinearClassifierTest.cpp, LinearRegressionTest.cpp, McSvm.cpp, SvmApproximationExample.cpp, SVMclassification-gnuplot.cpp, and SVMclassification.cpp.
Definition at line 203 of file Dataset.h.
| Dataset::Dataset | ( | const Dataset & | dataset | ) |
Construction of a Dataset from another Dataset.
Definition at line 418 of file Dataset.cpp.
References getTestData(), getTestTarget(), getTrainingData(), getTrainingTarget(), testData, testTarget, trainingData, and trainingTarget.
| Dataset::Dataset | ( | DataSource & | source, | |
| int | train, | |||
| int | test | |||
| ) |
Construction of a Dataset from a generic DataSource.
Definition at line 426 of file Dataset.cpp.
References DataSource::GetData(), testData, testTarget, trainingData, and trainingTarget.
| Dataset::Dataset | ( | const char * | filename, | |
| int | train, | |||
| int | test = 0 | |||
| ) |
Construction of a Dataset from a single file.
Definition at line 434 of file Dataset.cpp.
References DataFile::GetData(), DataFile::getNumberOfExamples(), testData, testTarget, trainingData, and trainingTarget.
| Dataset::Dataset | ( | const char * | filename, | |
| double | train | |||
| ) |
Construction of a Dataset from a single file.
Definition at line 446 of file Dataset.cpp.
References DataFile::GetData(), DataFile::getNumberOfExamples(), testData, testTarget, trainingData, and trainingTarget.
| Dataset::Dataset | ( | const char * | trainfile, | |
| const char * | testfile | |||
| ) |
Construction of a Dataset from a pair of files.
Definition at line 457 of file Dataset.cpp.
References DataFile::GetData(), DataFile::getNumberOfExamples(), testData, testTarget, trainingData, and trainingTarget.
| Dataset::Dataset | ( | const char * | trainfile, | |
| const char * | testfile, | |||
| int | train | |||
| ) |
Construction of a Dataset from a pair of files, but using a different data separation into training and test set.
Definition at line 467 of file Dataset.cpp.
References DataFile::GetData(), DataFile::getNumberOfExamples(), i, testData, testTarget, trainingData, and trainingTarget.
| Dataset::Dataset | ( | const char * | datafile, | |
| const char * | splitfile, | |||
| double | disambiguation | |||
| ) |
Construction of a Dataset from a data file and a split file.
Definition at line 529 of file Dataset.cpp.
References DataFile::GetData(), DataSource::getDataDimension(), DataFile::getNumberOfExamples(), DataSource::getTargetDimension(), i, ReadSplitFile(), testData, testTarget, trainingData, and trainingTarget.
| Dataset::Dataset | ( | const Array< double > & | trainingData, | |
| const Array< double > & | trainingTarget, | |||
| const Array< double > & | testData, | |||
| const Array< double > & | testTarget | |||
| ) |
| const Array<double>& Dataset::getTestData | ( | ) | const [inline] |
access to the test data as a constant array
Definition at line 257 of file Dataset.h.
Referenced by Dataset().
| const Array<double>& Dataset::getTestTarget | ( | ) | const [inline] |
access to the test targets as a constant array
Definition at line 263 of file Dataset.h.
Referenced by Dataset().
| const Array<double>& Dataset::getTrainingData | ( | ) | const [inline] |
access to the training data as a constant array
Definition at line 245 of file Dataset.h.
Referenced by Dataset().
| const Array<double>& Dataset::getTrainingTarget | ( | ) | const [inline] |
access to the training targets as a constant array
Definition at line 251 of file Dataset.h.
Referenced by Dataset().
| void Dataset::NormalizeComponents | ( | ) |
component wise normalization of the dataset
Definition at line 853 of file Dataset.cpp.
References i, testData, and trainingData.
| bool Dataset::ReadLine | ( | FILE * | file, | |
| char * | buffer, | |||
| int | bufferlength | |||
| ) | [protected] |
| bool Dataset::ReadSplitFile | ( | const char * | filename, | |
| std::vector< unsigned int > & | train, | |||
| std::vector< unsigned int > & | test | |||
| ) | [protected] |
| bool Dataset::Save | ( | const char * | filename, | |
| bool | training = true, |
|||
| bool | test = true, |
|||
| const char * | format = "ascii" | |||
| ) |
Save the current Dataset to a file.
| filename | name of the file, must not exist | |
| training | include the training data? | |
| test | include the test data? | |
| format | see description |
Definition at line 665 of file Dataset.cpp.
References Dataset_WriteType, i, testData, testTarget, trainingData, and trainingTarget.
| bool Dataset::SaveLIBSVM | ( | const char * | filename, | |
| bool | training = true, |
|||
| bool | test = true | |||
| ) |
Save the current Dataset in LIBSVM format.
| filename | name of the file, must not exist | |
| training | include the training data? | |
| test | include the test data? |
Definition at line 803 of file Dataset.cpp.
References i, testData, testTarget, trainingData, and trainingTarget.
| void Dataset::ShuffleAll | ( | ) |
shuffles the union of training and test examples, such that the number of training and test examples remains unchanged
Definition at line 624 of file Dataset.cpp.
References i, testData, testTarget, trainingData, and trainingTarget.
| void Dataset::ShuffleTest | ( | ) |
shuffles the test examples
Definition at line 604 of file Dataset.cpp.
References i, testData, and testTarget.
| void Dataset::ShuffleTraining | ( | ) |
shuffles the training examples
Definition at line 584 of file Dataset.cpp.
References i, trainingData, and trainingTarget.
Array<double> Dataset::testData [protected] |
Definition at line 320 of file Dataset.h.
Referenced by Dataset(), NormalizeComponents(), Save(), SaveLIBSVM(), ShuffleAll(), and ShuffleTest().
Array<double> Dataset::testTarget [protected] |
Definition at line 321 of file Dataset.h.
Referenced by Dataset(), Save(), SaveLIBSVM(), ShuffleAll(), and ShuffleTest().
Array<double> Dataset::trainingData [protected] |
Definition at line 318 of file Dataset.h.
Referenced by Dataset(), NormalizeComponents(), Save(), SaveLIBSVM(), ShuffleAll(), and ShuffleTraining().
Array<double> Dataset::trainingTarget [protected] |
Definition at line 319 of file Dataset.h.
Referenced by Dataset(), Save(), SaveLIBSVM(), ShuffleAll(), and ShuffleTraining().