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... | |
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) |
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.
typedef base_type::DataType shark::WeightedUnlabeledData< DataT >::DataType |
Definition at line 339 of file WeightedDataset.h.
typedef DataT shark::WeightedUnlabeledData< DataT >::InputType |
Definition at line 342 of file WeightedDataset.h.
typedef base_type::WeightType shark::WeightedUnlabeledData< DataT >::WeightType |
Definition at line 340 of file WeightedDataset.h.
|
inline |
Empty data set.
Definition at line 349 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 355 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 366 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 373 of file WeightedDataset.h.
|
inline |
Construction from data and a constant weight for all elements.
Definition at line 378 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 385 of file WeightedDataset.h.
|
inline |
Access to the inputs as a separate container.
Definition at line 389 of file WeightedDataset.h.
|
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.
|
friend |
Definition at line 401 of file WeightedDataset.h.