SG++
python.data.DataContainer.DataContainer Class Reference

A collection of data It can contain data sets for different categories, like "train" and "test" data. More...

Inheritance diagram for python.data.DataContainer.DataContainer:

Public Member Functions

def __contains__ (self, key)
 
def __getitem__ (self, item)
 Implementation of iterator method getitem() More...
 
def __init__ (self, kwargs)
 Constructor possible parameter combinations: DataContainer(adapter) DataContainer(array, array) DataContainer(size, dim, [name="train", filename=None]) DataContianer(points, values, [name="train", filename=None]) More...
 
def __iter__ (self)
 Implementation of iterator method iter() iterates through the container. More...
 
def combine (self, container)
 Merge to Data container into one, so it stores several data sets with different categories. More...
 
def createNullVector (self, size, dim)
 Create DataVector of given size and dimension with 0 for all entries. More...
 
def delTrainingData (self)
 
def fromJson (cls, jsonObject)
 Restores the DataContainer object from the json object with attributes. More...
 
def getDataSubsetByCategory (self, category)
 Returns the data set which belongs to certain category. More...
 
def getDataSubsetByIndexList (self, indices, name="train")
 Creates DataContainer with entries from the given list. More...
 
def getDim (self)
 Returns dimension of the default data set. More...
 
def getName (self)
 Return the default name of data set. More...
 
def getPoints (self, category=None)
 Returns points stored in the data set with default name. More...
 
def getPointstoValuesMap (self)
 
def getPointsValues (self)
 Return tuple of points and values. More...
 
def getSize (self)
 Returns size of the default data set. More...
 
def getSizeTest (self)
 
def getSizeTrain (self)
 
def getSpecifiction (self)
 Return the data specification of the default category. More...
 
def getTestDataset (self)
 Creates DataContainer only with test data set. More...
 
def getTrainDataset (self)
 Creates DataContainer only with train data set. More...
 
def getValues (self, category=None)
 Returns values stored in the data set with default name. More...
 
def merge (cls, containerList)
 Merges several data containers to one. More...
 
def next (self)
 Implementation of iterator method next() More...
 
def toString (self)
 Returns a string that represents the object. More...
 

Static Public Attributes

 dataDict = None
 
 dim = None
 Dimension of the default data set. More...
 
 name = None
 Category name of the default data set. More...
 
 points = None
 Dictionary for points from different categories of data sets. More...
 
 size = None
 Size of the default data set. More...
 
 specifications = None
 Specification of attributes of default data set. More...
 
 tempPoint = None
 Used for manipulations with points DataVector. More...
 
 tempValue = None
 Used for manipulations with values DataVector. More...
 
string TEST_CATEGORY = 'test'
 Constants category names - validation data. More...
 
string TRAIN_CATEGORY = 'train'
 Constants category names - training data. More...
 
 values = None
 Dictionary for values from different categories of data sets. More...
 

Detailed Description

A collection of data It can contain data sets for different categories, like "train" and "test" data.

Implements some common operation on sets, like combining of two containers to one, as well as access to data levels, e.g. subset, points, values.

The objects of DataContainer are iterable, so user can iterate through the points and values of the subset of default category defined in the attribute name.

Constructor & Destructor Documentation

def python.data.DataContainer.DataContainer.__init__ (   self,
  kwargs 
)

Constructor possible parameter combinations: DataContainer(adapter) DataContainer(array, array) DataContainer(size, dim, [name="train", filename=None]) DataContianer(points, values, [name="train", filename=None])

param adapter: Object implementing DataContainer param size: Integer size of data set param dim: Integer dimension of data set param name: category name, default: "train" param points: DataVector with points param values: DataVector with values

References python.data.DataContainer.DataContainer.dataDict, python.data.DataContainer.DataContainer.dim, sgpp::base::ForwardSelectorRefinement_refinement_key.dim, sgpp::base::ImpurityRefinement_refinement_key.dim, sgpp::base::PredictiveRefinement_refinement_key.dim, python.data.DataContainer.DataContainer.name, sgpp::combigrid::L2LejaPointDistribution.points, sgpp::combigrid::LejaPointDistribution.points, sgpp::combigrid::LagrangePolynom.points, sgpp::combigrid::NestedPointHierarchy.points, sgpp::combigrid::NonNestedPointHierarchy.points, python.data.DataContainer.DataContainer.points, sgpp::base::MultipleClassRefinement.points, python.test.LejaPlotter.points, python.data.DataContainer.DataContainer.size, sgpp::base::DataVectorSP.size, python.data.DataContainer.DataContainer.specifications, python.data.DataContainer.DataContainer.tempPoint, python.data.DataContainer.DataContainer.tempValue, python.data.DataContainer.DataContainer.TRAIN_CATEGORY, sgpp::combigrid::FloatTensorVector.values, sgpp::combigrid::FloatArrayVector.values, and python.data.DataContainer.DataContainer.values.

Member Function Documentation

def python.data.DataContainer.DataContainer.__contains__ (   self,
  key 
)
def python.data.DataContainer.DataContainer.__getitem__ (   self,
  item 
)

Implementation of iterator method getitem()

Parameters
iteminteger index of the item in container
Returns
: entry with given index in the container

References python.data.DataContainer.DataContainer.dataDict, python.data.DataContainer.DataContainer.name, sgpp::combigrid::L2LejaPointDistribution.points, sgpp::combigrid::LejaPointDistribution.points, sgpp::combigrid::LagrangePolynom.points, sgpp::combigrid::NestedPointHierarchy.points, sgpp::combigrid::NonNestedPointHierarchy.points, python.data.DataContainer.DataContainer.points, sgpp::base::MultipleClassRefinement.points, python.test.LejaPlotter.points, python.data.DataContainer.DataContainer.tempPoint, python.data.DataContainer.DataContainer.tempValue, sgpp::combigrid::FloatTensorVector.values, sgpp::combigrid::FloatArrayVector.values, and python.data.DataContainer.DataContainer.values.

def python.data.DataContainer.DataContainer.__iter__ (   self)

Implementation of iterator method iter() iterates through the container.

References python.data.DataContainer.DataContainer.next().

def python.data.DataContainer.DataContainer.combine (   self,
  container 
)

Merge to Data container into one, so it stores several data sets with different categories.

Parameters
containerDataContainer that has to be combined with the called one
Returns
: new DataContainer with several data sets

References python.data.DataContainer.DataContainer.dataDict, sgpp::combigrid::NonNestedPointHierarchy.getPoints(), sgpp::combigrid::AbstractPointHierarchy.getPoints(), sgpp::combigrid::NestedPointHierarchy.getPoints(), python.data.DataContainer.DataContainer.getPoints(), sgpp::combigrid::FloatTensorVector.getValues(), sgpp::combigrid::FloatArrayVector.getValues(), python.data.DataContainer.DataContainer.getValues(), python.data.DataContainer.DataContainer.name, sgpp::combigrid::L2LejaPointDistribution.points, sgpp::combigrid::LejaPointDistribution.points, sgpp::combigrid::LagrangePolynom.points, sgpp::combigrid::NestedPointHierarchy.points, sgpp::combigrid::NonNestedPointHierarchy.points, python.data.DataContainer.DataContainer.points, sgpp::base::MultipleClassRefinement.points, python.test.LejaPlotter.points, python.data.DataContainer.DataContainer.specifications, sgpp::combigrid::FloatTensorVector.values, sgpp::combigrid::FloatArrayVector.values, and python.data.DataContainer.DataContainer.values.

def python.data.DataContainer.DataContainer.createNullVector (   self,
  size,
  dim 
)

Create DataVector of given size and dimension with 0 for all entries.

Parameters
sizeInteger size of the DataVector
dimInteger dimension of the DataVector
Returns
: new DataVector with 0 for all entries
def python.data.DataContainer.DataContainer.delTrainingData (   self)

References python.data.DataContainer.DataContainer.dataDict, sgpp::combigrid::L2LejaPointDistribution.points, sgpp::combigrid::LejaPointDistribution.points, sgpp::combigrid::LagrangePolynom.points, sgpp::combigrid::NestedPointHierarchy.points, sgpp::combigrid::NonNestedPointHierarchy.points, python.data.DataContainer.DataContainer.points, sgpp::base::MultipleClassRefinement.points, python.test.LejaPlotter.points, python.data.DataContainer.DataContainer.TRAIN_CATEGORY, sgpp::combigrid::FloatTensorVector.values, sgpp::combigrid::FloatArrayVector.values, and python.data.DataContainer.DataContainer.values.

def python.data.DataContainer.DataContainer.fromJson (   cls,
  jsonObject 
)

Restores the DataContainer object from the json object with attributes.

Parameters
clspython keyword for class method (no specification needed)
jsonObjectA json object.
Returns
The restored DataContainer object.

Referenced by python.uq.sampler.asgc.ASGCSampler.ASGCSampler.setMemento(), python.uq.analysis.asgc.ASGCKnowledge.ASGCKnowledge.setMemento(), python.uq.learner.Learner.Learner.setMemento(), python.learner.Learner.Learner.setMemento(), and python.uq.uq_setting.UQSetting.UQSetting.setMemento().

def python.data.DataContainer.DataContainer.getDataSubsetByCategory (   self,
  category 
)

Returns the data set which belongs to certain category.

Parameters
categoryString category name (train or test)
Returns
: DataContainer only with requested data set
Exceptions
ifrequested category name doesn't exist

References sgpp::combigrid::L2LejaPointDistribution.points, sgpp::combigrid::LejaPointDistribution.points, sgpp::combigrid::LagrangePolynom.points, sgpp::combigrid::NestedPointHierarchy.points, sgpp::combigrid::NonNestedPointHierarchy.points, python.data.DataContainer.DataContainer.points, sgpp::base::MultipleClassRefinement.points, python.test.LejaPlotter.points, sgpp::combigrid::FloatTensorVector.values, sgpp::combigrid::FloatArrayVector.values, and python.data.DataContainer.DataContainer.values.

Referenced by python.data.DataContainer.DataContainer.getTestDataset(), and python.data.DataContainer.DataContainer.getTrainDataset().

def python.data.DataContainer.DataContainer.getDataSubsetByIndexList (   self,
  indices,
  name = "train" 
)

Creates DataContainer with entries from the given list.

Parameters
indiceslist of indices
nameString for category name of data set, default: "train"
Returns
: DataContainer with entries from the given list

References python.data.DataContainer.DataContainer.dim, sgpp::base::ForwardSelectorRefinement_refinement_key.dim, sgpp::base::ImpurityRefinement_refinement_key.dim, sgpp::base::PredictiveRefinement_refinement_key.dim, sgpp::combigrid::NonNestedPointHierarchy.getPoints(), sgpp::combigrid::AbstractPointHierarchy.getPoints(), sgpp::combigrid::NestedPointHierarchy.getPoints(), python.data.DataContainer.DataContainer.getPoints(), sgpp::combigrid::FloatTensorVector.getValues(), sgpp::combigrid::FloatArrayVector.getValues(), and python.data.DataContainer.DataContainer.getValues().

def python.data.DataContainer.DataContainer.getDim (   self)

Returns dimension of the default data set.

Returns
: Integer dimension

References python.data.DataContainer.DataContainer.dim, sgpp::base::ForwardSelectorRefinement_refinement_key.dim, sgpp::base::ImpurityRefinement_refinement_key.dim, sgpp::base::PredictiveRefinement_refinement_key.dim, python.data.DataContainer.DataContainer.name, sgpp::combigrid::L2LejaPointDistribution.points, sgpp::combigrid::LejaPointDistribution.points, sgpp::combigrid::LagrangePolynom.points, sgpp::combigrid::NestedPointHierarchy.points, sgpp::combigrid::NonNestedPointHierarchy.points, python.data.DataContainer.DataContainer.points, sgpp::base::MultipleClassRefinement.points, and python.test.LejaPlotter.points.

Referenced by python.uq.dists.Dist.Dist.cov(), python.uq.parameters.ParameterSet.ParameterSet.extractActiveSubset(), and python.uq.uq_setting.UQSetting.UQSetting.getDim().

def python.data.DataContainer.DataContainer.getName (   self)

Return the default name of data set.

Returns
: String category name

References python.data.DataContainer.DataContainer.name.

def python.data.DataContainer.DataContainer.getPoints (   self,
  category = None 
)

Returns points stored in the data set with default name.

Parameters
categoryString category name of the requested data ("train" or "test")
Returns
: DataVector of points

References python.data.DataContainer.DataContainer.name, sgpp::combigrid::L2LejaPointDistribution.points, sgpp::combigrid::LejaPointDistribution.points, sgpp::combigrid::LagrangePolynom.points, sgpp::combigrid::NestedPointHierarchy.points, sgpp::combigrid::NonNestedPointHierarchy.points, python.data.DataContainer.DataContainer.points, sgpp::base::MultipleClassRefinement.points, and python.test.LejaPlotter.points.

Referenced by python.data.DataContainer.DataContainer.combine(), python.data.DataContainer.DataContainer.getDataSubsetByIndexList(), python.data.DataContainer.DataContainer.getPointsValues(), and python.data.DataContainer.DataContainer.toString().

def python.data.DataContainer.DataContainer.getPointstoValuesMap (   self)
def python.data.DataContainer.DataContainer.getSize (   self)

Returns size of the default data set.

Returns
: Integer size

References python.data.DataContainer.DataContainer.name, sgpp::combigrid::L2LejaPointDistribution.points, sgpp::combigrid::LejaPointDistribution.points, sgpp::combigrid::LagrangePolynom.points, sgpp::combigrid::NestedPointHierarchy.points, sgpp::combigrid::NonNestedPointHierarchy.points, python.data.DataContainer.DataContainer.points, sgpp::base::MultipleClassRefinement.points, python.test.LejaPlotter.points, python.data.DataContainer.DataContainer.size, and sgpp::base::DataVectorSP.size.

Referenced by python.uq.uq_setting.UQSetting.UQSetting.convert(), python.uq.uq_setting.UQSetting.UQSetting.getTimeDependentResults(), python.uq.uq_setting.UQSetting.UQSetting.runSamples(), and python.uq.uq_setting.UQSetting.UQSetting.runSamples_withoutDistribution().

def python.data.DataContainer.DataContainer.getSizeTest (   self)
def python.data.DataContainer.DataContainer.getSizeTrain (   self)
def python.data.DataContainer.DataContainer.getSpecifiction (   self)

Return the data specification of the default category.

Returns
: the DataSpecification object

References python.data.DataContainer.DataContainer.name, and python.data.DataContainer.DataContainer.specifications.

def python.data.DataContainer.DataContainer.getTestDataset (   self)
def python.data.DataContainer.DataContainer.getTrainDataset (   self)
def python.data.DataContainer.DataContainer.getValues (   self,
  category = None 
)

Returns values stored in the data set with default name.

Parameters
categoryString category name of the requested data ("train" or "test")
Returns
: DataVector of values

References python.data.DataContainer.DataContainer.name, sgpp::combigrid::FloatTensorVector.values, sgpp::combigrid::FloatArrayVector.values, and python.data.DataContainer.DataContainer.values.

Referenced by python.data.DataContainer.DataContainer.combine(), python.data.DataContainer.DataContainer.getDataSubsetByIndexList(), python.data.DataContainer.DataContainer.getPointsValues(), and python.data.DataContainer.DataContainer.toString().

def python.data.DataContainer.DataContainer.merge (   cls,
  containerList 
)

Merges several data containers to one.

Unlike combine(), this method actually merges the set of points and values and not just puts them to the different categories

Parameters
clspython keyword (no specification required)
containerListlist of DataContainer's

References python.data.DataContainer.DataContainer.dataDict, sgpp::combigrid::L2LejaPointDistribution.points, sgpp::combigrid::LejaPointDistribution.points, sgpp::combigrid::LagrangePolynom.points, sgpp::combigrid::NestedPointHierarchy.points, sgpp::combigrid::NonNestedPointHierarchy.points, python.data.DataContainer.DataContainer.points, sgpp::base::MultipleClassRefinement.points, python.test.LejaPlotter.points, python.data.DataContainer.DataContainer.specifications, sgpp::combigrid::FloatTensorVector.values, sgpp::combigrid::FloatArrayVector.values, and python.data.DataContainer.DataContainer.values.

def python.data.DataContainer.DataContainer.next (   self)

Implementation of iterator method next()

Returns
: the next element in the container

References python.data.DataContainer.DataContainer.name, sgpp::combigrid::L2LejaPointDistribution.points, sgpp::combigrid::LejaPointDistribution.points, sgpp::combigrid::LagrangePolynom.points, sgpp::combigrid::NestedPointHierarchy.points, sgpp::combigrid::NonNestedPointHierarchy.points, python.data.DataContainer.DataContainer.points, sgpp::base::MultipleClassRefinement.points, python.test.LejaPlotter.points, python.data.DataContainer.DataContainer.size, sgpp::base::DataVectorSP.size, python.data.DataContainer.DataContainer.tempPoint, python.data.DataContainer.DataContainer.tempValue, sgpp::combigrid::FloatTensorVector.values, sgpp::combigrid::FloatArrayVector.values, and python.data.DataContainer.DataContainer.values.

Referenced by python.learner.folding.FoldingPolicy.FoldingPolicy.__iter__(), and python.data.DataContainer.DataContainer.__iter__().

Member Data Documentation

python.data.DataContainer.DataContainer.size = None
static
python.data.DataContainer.DataContainer.tempPoint = None
static
python.data.DataContainer.DataContainer.tempValue = None
static
string python.data.DataContainer.DataContainer.TEST_CATEGORY = 'test'
static
string python.data.DataContainer.DataContainer.TRAIN_CATEGORY = 'train'
static

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