SG++-Doxygen-Documentation
|
Dataset that can be ordered. Accessing the included DataMatrix might invalidate the order. More...
#include <SortedDataset.hpp>
Public Types | |
enum | OrderType { None, External, Random, Morton, Invalid } |
Available permutations. More... | |
Public Member Functions | |
sgpp::base::DataMatrix & | getData () |
Sets the OrderType to OrderType::Invalid. More... | |
OrderType | getOrderType () const |
Returns current order type. More... | |
void | restoreOrder () |
Restores the original order in case of a valid order type. Sets ot to OrderType::None. More... | |
void | setOrder (OrderType order) |
Sets the order for the dataset and rearranges the data. More... | |
void | setOrder (const std::vector< size_t > &permutation) |
Reorders the data with a given permutation. More... | |
SortedDataset () | |
Constructs an empty dataset (zero size). More... | |
SortedDataset (size_t numberInstances, size_t dimension) | |
Constructs an empty dataset with given size. More... | |
SortedDataset (const Dataset &src) | |
Constructs a copy of a dataset. More... | |
Public Member Functions inherited from sgpp::datadriven::Dataset | |
Dataset () | |
Constructs an empty dataset (zero size). More... | |
Dataset (size_t numberInstances, size_t dimension) | |
Constructs an empty dataset with given size. More... | |
sgpp::base::DataMatrix & | getData () |
const sgpp::base::DataMatrix & | getData () const |
size_t | getDimension () const |
size_t | getNumberInstances () const |
sgpp::base::DataVector & | getTargets () |
const sgpp::base::DataVector & | getTargets () const |
Protected Member Functions | |
void | usePermutation () |
uses the permutation on the DataMatrix and the DataVector More... | |
Protected Attributes | |
OrderType | ot |
std::vector< size_t > | perm |
Protected Attributes inherited from sgpp::datadriven::Dataset | |
sgpp::base::DataMatrix | data |
size_t | dimension |
size_t | numberInstances |
sgpp::base::DataVector | targets |
Dataset that can be ordered. Accessing the included DataMatrix might invalidate the order.
sgpp::datadriven::SortedDataset::SortedDataset | ( | ) |
Constructs an empty dataset (zero size).
References python.classifier::None, and ot.
sgpp::datadriven::SortedDataset::SortedDataset | ( | size_t | numberInstances, |
size_t | dimension | ||
) |
Constructs an empty dataset with given size.
numberInstances | number of instances in the dataset |
dimension | number of dimensions in the dataset |
References python.statsfileInfo::i, python.classifier::None, and ot.
|
explicit |
Constructs a copy of a dataset.
References sgpp::datadriven::Dataset::getNumberInstances(), python.statsfileInfo::i, python.classifier::None, and ot.
sgpp::base::DataMatrix & sgpp::datadriven::SortedDataset::getData | ( | ) |
Sets the OrderType to OrderType::Invalid.
References sgpp::datadriven::Dataset::getData(), and ot.
SortedDataset::OrderType sgpp::datadriven::SortedDataset::getOrderType | ( | ) | const |
Returns current order type.
References ot.
void sgpp::datadriven::SortedDataset::restoreOrder | ( | ) |
Restores the original order in case of a valid order type. Sets ot to OrderType::None.
References sgpp::datadriven::Dataset::data, sgpp::base::DataMatrix::getNcols(), python.statsfileInfo::i, ot, and sgpp::datadriven::Dataset::targets.
void sgpp::datadriven::SortedDataset::setOrder | ( | OrderType | order | ) |
Sets the order for the dataset and rearranges the data.
The order is unchanged in case of OrderType::External. OrderType::None creates the identity permutation.
The order is unchanged in case of OrderType::External.
References python.statsfileInfo::i, python.classifier::None, sgpp::datadriven::Dataset::numberInstances, ot, and usePermutation().
void sgpp::datadriven::SortedDataset::setOrder | ( | const std::vector< size_t > & | permutation | ) |
Reorders the data with a given permutation.
Sets the order type to OrderType::External If the permutation is invalid due to a size or index mismatch, ot is set to OrderType::Invalid. The i-th data value is permuted to the permutation[i]-th position.
References python.uq.tools::check(), python.statsfileInfo::i, python.uq.operations.sparse_grid::isValid(), sgpp::datadriven::Dataset::numberInstances, ot, and usePermutation().
|
protected |
uses the permutation on the DataMatrix and the DataVector
References sgpp::datadriven::Dataset::data, sgpp::base::DataMatrix::getNcols(), python.statsfileInfo::i, and sgpp::datadriven::Dataset::targets.
Referenced by setOrder().
|
protected |
Referenced by getData(), getOrderType(), restoreOrder(), setOrder(), and SortedDataset().
|
protected |