Data set for supervised learning. More...
#include <shark/Data/Dataset.h>
Public Member Functions | |
BOOST_STATIC_CONSTANT (std::size_t, DefaultBatchSize=InputContainer::DefaultBatchSize) | |
const_element_range | elements () const |
Returns the range of elements. More... | |
element_range | elements () |
Returns therange of elements. More... | |
const_batch_range | batches () const |
Returns the range of batches. More... | |
batch_range | batches () |
Returns the range of batches. More... | |
std::size_t | numberOfBatches () const |
Returns the number of batches of the set. More... | |
std::size_t | numberOfElements () const |
Returns the total number of elements. More... | |
bool | empty () const |
Check whether the set is empty. More... | |
InputContainer const & | inputs () const |
Access to inputs as a separate container. More... | |
InputContainer & | inputs () |
Access to inputs as a separate container. More... | |
LabelContainer const & | labels () const |
Access to labels as a separate container. More... | |
LabelContainer & | labels () |
Access to labels as a separate container. More... | |
LabeledData () | |
Empty data set. More... | |
LabeledData (std::size_t numBatches) | |
Create an empty set with just the correct number of batches. More... | |
LabeledData (std::size_t size, element_type const &element, std::size_t batchSize=DefaultBatchSize) | |
LabeledData (Data< InputType > const &inputs, Data< LabelType > const &labels) | |
Construction from data. More... | |
element_reference | element (std::size_t i) |
const_element_reference | element (std::size_t i) const |
batch_reference | batch (std::size_t i) |
const_batch_reference | batch (std::size_t i) const |
void | read (InArchive &archive) |
from ISerializable More... | |
void | write (OutArchive &archive) const |
from ISerializable More... | |
virtual void | makeIndependent () |
This method makes the vector independent of all siblings and parents. More... | |
virtual void | shuffle () |
shuffles all elements in the entire dataset (that is, also across the batches) More... | |
void | splitBatch (std::size_t batch, std::size_t elementIndex) |
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... | |
void | append (self_type const &other) |
Appends the contents of another data object to the end. More... | |
void | push_back (typename Batch< InputType >::type const &inputs, typename Batch< LabelType >::type const &labels) |
void | push_back (const_batch_reference batch) |
template<class Range > | |
void | repartition (Range const &batchSizes) |
Reorders the batch structure in the container to that indicated by the batchSizes vector. More... | |
std::vector< std::size_t > | getPartitioning () const |
Creates a vector with the batch sizes of every batch. More... | |
void | indexedSubset (IndexSet const &indices, self_type &subset) const |
Fill in the subset defined by the list of indices. More... | |
void | indexedSubset (IndexSet const &indices, self_type &subset, self_type &complement) const |
Fill in the subset defined by the list of indices as well as its complement. More... | |
![]() | |
virtual | ~ISerializable () |
Virtual d'tor. More... | |
void | load (InArchive &archive, unsigned int version) |
Versioned loading of components, calls read(...). More... | |
void | save (OutArchive &archive, unsigned int version) const |
Versioned storing of components, calls write(...). More... | |
BOOST_SERIALIZATION_SPLIT_MEMBER () | |
Protected Attributes | |
InputContainer | m_data |
LabelContainer | m_label |
point data More... | |
Friends | |
void | swap (LabeledData &a, LabeledData &b) |
Data set for supervised learning.
The LabeledData class extends UnlabeledData for the representation of inputs. In addition it holds and provides access to the corresponding labels.
LabeledData tries to mimic the underlying data as pairs of input and label data. 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).input and the labels by batch(i).label
this also holds true for single element access using operator(). Be aware, that direct access to an element is a linear time operation. So it is not advisable to iterate over the elements, but instead iterate over the batches.