shark::WeightedUnlabeledData< DataT > Class Template Reference

Weighted data set for unsupervised learning. More...

#include <shark/Data/WeightedDataset.h>

+ Inheritance diagram for shark::WeightedUnlabeledData< DataT >:

Public Types

typedef base_type::DataType DataType
 
typedef base_type::WeightType WeightType
 
typedef DataT InputType
 

Public Member Functions

 BOOST_STATIC_CONSTANT (std::size_t, DefaultBatchSize=UnlabeledData< DataT >::DefaultBatchSize)
 
 WeightedUnlabeledData ()
 Empty data set. More...
 
 WeightedUnlabeledData (std::size_t numBatches)
 Create an empty set with just the correct number of batches. More...
 
 WeightedUnlabeledData (std::size_t size, element_type const &element, std::size_t batchSize=DefaultBatchSize)
 Construtor using a single element as blueprint to create a dataset with a specified number of elements. More...
 
 WeightedUnlabeledData (UnlabeledData< DataType > const &data, Data< WeightType > const &weights)
 Construction from data. More...
 
 WeightedUnlabeledData (UnlabeledData< DataType > const &data, double weight)
 Construction from data and a constant weight for all elements. More...
 
UnlabeledData< DataT > const & inputs () const
 Access to the inputs as a separate container. More...
 
UnlabeledData< DataT > & inputs ()
 Access to the inputs as a separate container. More...
 
self_type splice (std::size_t batch)
 Splits the container into two independent parts. The left part remains in the container, the right is stored as return type. More...
 

Friends

void swap (WeightedUnlabeledData &a, WeightedUnlabeledData &b)
 

Detailed Description

template<class DataT>
class shark::WeightedUnlabeledData< DataT >

Weighted data set for unsupervised learning.

The WeightedUnlabeledData class extends UnlabeledData for the representation of data. In addition it holds and provides access to the corresponding weights.

WeightedUnlabeledData tries to mimic the underlying data as pairs of data points and weights. this means that when accessing a batch by calling batch(i) or choosing one of the iterators one access the input batch by batch(i).data and the weights by batch(i).weight

this also holds true for single element access using operator(). Be aware, that direct access to element is a linear time operation. So it is not advisable to iterate over the elements, but instead iterate over the batches.

Definition at line 331 of file WeightedDataset.h.

Member Typedef Documentation

§ DataType

template<class DataT>
typedef base_type::DataType shark::WeightedUnlabeledData< DataT >::DataType

Definition at line 339 of file WeightedDataset.h.

§ InputType

template<class DataT>
typedef DataT shark::WeightedUnlabeledData< DataT >::InputType

Definition at line 342 of file WeightedDataset.h.

§ WeightType

template<class DataT>
typedef base_type::WeightType shark::WeightedUnlabeledData< DataT >::WeightType

Definition at line 340 of file WeightedDataset.h.

Constructor & Destructor Documentation

§ WeightedUnlabeledData() [1/5]

template<class DataT>
shark::WeightedUnlabeledData< DataT >::WeightedUnlabeledData ( )
inline

Empty data set.

Definition at line 349 of file WeightedDataset.h.

§ WeightedUnlabeledData() [2/5]

template<class DataT>
shark::WeightedUnlabeledData< DataT >::WeightedUnlabeledData ( std::size_t  numBatches)
inline

Create an empty set with just the correct number of batches.

The user must initialize the dataset after that by himself.

Definition at line 355 of file WeightedDataset.h.

§ WeightedUnlabeledData() [3/5]

template<class DataT>
shark::WeightedUnlabeledData< DataT >::WeightedUnlabeledData ( std::size_t  size,
element_type const &  element,
std::size_t  batchSize = DefaultBatchSize 
)
inline

Construtor using a single element as blueprint to create a dataset with a specified number of elements.

Optionally the desired batch Size can be set

Parameters
sizethe new size of the container
elementthe blueprint element from which to create the Container
batchSizethe size of the batches. if this is 0, the size is unlimited

Definition at line 366 of file WeightedDataset.h.

§ WeightedUnlabeledData() [4/5]

template<class DataT>
shark::WeightedUnlabeledData< DataT >::WeightedUnlabeledData ( UnlabeledData< DataType > const &  data,
Data< WeightType > const &  weights 
)
inline

Construction from data.

Beware that when calling this constructor the organization of batches must be equal in both containers. This Constructor will not reorganize the data!

Definition at line 373 of file WeightedDataset.h.

§ WeightedUnlabeledData() [5/5]

template<class DataT>
shark::WeightedUnlabeledData< DataT >::WeightedUnlabeledData ( UnlabeledData< DataType > const &  data,
double  weight 
)
inline

Construction from data and a constant weight for all elements.

Definition at line 378 of file WeightedDataset.h.

Member Function Documentation

§ BOOST_STATIC_CONSTANT()

template<class DataT>
shark::WeightedUnlabeledData< DataT >::BOOST_STATIC_CONSTANT ( std::size_t  ,
DefaultBatchSize  = UnlabeledData< DataT >::DefaultBatchSize 
)

§ inputs() [1/2]

template<class DataT>
UnlabeledData<DataT> const& shark::WeightedUnlabeledData< DataT >::inputs ( ) const
inline

Access to the inputs as a separate container.

Definition at line 385 of file WeightedDataset.h.

§ inputs() [2/2]

template<class DataT>
UnlabeledData<DataT>& shark::WeightedUnlabeledData< DataT >::inputs ( )
inline

Access to the inputs as a separate container.

Definition at line 389 of file WeightedDataset.h.

§ splice()

template<class DataT>
self_type shark::WeightedUnlabeledData< DataT >::splice ( std::size_t  batch)
inline

Splits the container into two independent parts. The left part remains in the container, the right is stored as return type.

Order of elements remain unchanged. The SharedVector is not allowed to be shared for this to work.

Definition at line 397 of file WeightedDataset.h.

Friends And Related Function Documentation

§ swap

template<class DataT>
void swap ( WeightedUnlabeledData< DataT > &  a,
WeightedUnlabeledData< DataT > &  b 
)
friend

Definition at line 401 of file WeightedDataset.h.


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