SG++-Doxygen-Documentation
sgpp::datadriven::SortedDataset Class Reference

Dataset that can be ordered. Accessing the included DataMatrix might invalidate the order. More...

#include <SortedDataset.hpp>

Inheritance diagram for sgpp::datadriven::SortedDataset:
sgpp::datadriven::Dataset

Public Types

enum  OrderType {
  None, External, Random, Morton,
  Invalid
}
 Available permutations. More...
 

Public Member Functions

sgpp::base::DataMatrixgetData ()
 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::DataMatrixgetData ()
 
const sgpp::base::DataMatrixgetData () const
 
size_t getDimension () const
 
size_t getNumberInstances () const
 
sgpp::base::DataVectorgetTargets ()
 
const sgpp::base::DataVectorgetTargets () 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
 

Detailed Description

Dataset that can be ordered. Accessing the included DataMatrix might invalidate the order.

Member Enumeration Documentation

◆ OrderType

Available permutations.

Enumerator
None 
External 
Random 
Morton 
Invalid 

Constructor & Destructor Documentation

◆ SortedDataset() [1/3]

sgpp::datadriven::SortedDataset::SortedDataset ( )

Constructs an empty dataset (zero size).

References python.classifier::None, and ot.

◆ SortedDataset() [2/3]

sgpp::datadriven::SortedDataset::SortedDataset ( size_t  numberInstances,
size_t  dimension 
)

Constructs an empty dataset with given size.

Parameters
numberInstancesnumber of instances in the dataset
dimensionnumber of dimensions in the dataset

References python.statsfileInfo::i, python.classifier::None, and ot.

◆ SortedDataset() [3/3]

sgpp::datadriven::SortedDataset::SortedDataset ( const Dataset src)
explicit

Member Function Documentation

◆ getData()

sgpp::base::DataMatrix & sgpp::datadriven::SortedDataset::getData ( )

Sets the OrderType to OrderType::Invalid.

Returns
training data of the dataset

References sgpp::datadriven::Dataset::getData(), and ot.

◆ getOrderType()

SortedDataset::OrderType sgpp::datadriven::SortedDataset::getOrderType ( ) const

Returns current order type.

References ot.

◆ restoreOrder()

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.

◆ setOrder() [1/2]

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().

◆ setOrder() [2/2]

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().

◆ usePermutation()

void sgpp::datadriven::SortedDataset::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().

Member Data Documentation

◆ ot

OrderType sgpp::datadriven::SortedDataset::ot
protected

◆ perm

std::vector<size_t> sgpp::datadriven::SortedDataset::perm
protected

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