Weighted data set for unsupervised learning. More...
#include <shark/Data/WeightedDataset.h>
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... | |
Shape const & | shape () const |
Returns the Shape of the data. More... | |
Shape & | shape () |
Returns the Shape of the data. More... | |
WeightedUnlabeledData | 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) |
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 446 of file WeightedDataset.h.
typedef base_type::DataType shark::WeightedUnlabeledData< DataT >::DataType |
Definition at line 453 of file WeightedDataset.h.
typedef DataT shark::WeightedUnlabeledData< DataT >::InputType |
Definition at line 456 of file WeightedDataset.h.
typedef base_type::WeightType shark::WeightedUnlabeledData< DataT >::WeightType |
Definition at line 454 of file WeightedDataset.h.
|
inline |
Empty data set.
Definition at line 463 of file WeightedDataset.h.
|
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 469 of file WeightedDataset.h.
|
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
size | the new size of the container |
element | the blueprint element from which to create the Container |
batchSize | the size of the batches. if this is 0, the size is unlimited |
Definition at line 480 of file WeightedDataset.h.
|
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 487 of file WeightedDataset.h.
|
inline |
Construction from data and a constant weight for all elements.
Definition at line 492 of file WeightedDataset.h.
shark::WeightedUnlabeledData< DataT >::BOOST_STATIC_CONSTANT | ( | std::size_t | , |
DefaultBatchSize | = UnlabeledData< DataT >::DefaultBatchSize |
||
) |
|
inline |
Access to the inputs as a separate container.
Definition at line 499 of file WeightedDataset.h.
References shark::WeightedDataPair< DataType, WeightType >::data.
|
inline |
Access to the inputs as a separate container.
Definition at line 503 of file WeightedDataset.h.
References shark::WeightedDataPair< DataType, WeightType >::data.
|
inline |
Returns the Shape of the data.
Definition at line 508 of file WeightedDataset.h.
References shark::WeightedDataPair< DataType, WeightType >::data.
Referenced by shark::bootstrap().
|
inline |
Returns the Shape of the data.
Definition at line 513 of file WeightedDataset.h.
References shark::WeightedDataPair< DataType, WeightType >::data.
|
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 520 of file WeightedDataset.h.
References shark::WeightedDataPair< DataType, WeightType >::data.
|
friend |
Definition at line 524 of file WeightedDataset.h.