Dataset.h File Reference
#include <boost/range/iterator_range.hpp>
#include <shark/Core/Exception.h>
#include <shark/Core/OpenMP.h>
#include <shark/Core/utility/functional.h>
#include <boost/iterator/transform_iterator.hpp>
#include <shark/Core/Random.h>
#include <shark/Core/Shape.h>
#include "Impl/Dataset.inl"

Go to the source code of this file.

Classes

class  shark::Data< Type >
 Data container. More...
 
class  shark::UnlabeledData< InputT >
 Data set for unsupervised learning. More...
 
class  shark::LabeledData< InputT, LabelT >
 Data set for supervised learning. More...
 
struct  shark::TransformedData< Functor, T >
 

Namespaces

 shark
 AbstractMultiObjectiveOptimizer.
 

Typedefs

typedef LabeledData< RealVector, unsigned int > shark::ClassificationDataset
 specialized template for classification with unsigned int labels More...
 
typedef LabeledData< RealVector, RealVector > shark::RegressionDataset
 specialized template for regression with RealVector labels More...
 
typedef LabeledData< CompressedRealVector, unsigned int > shark::CompressedClassificationDataset
 specialized template for classification with unsigned int labels and sparse data More...
 

Functions

template<class Range >
Data< typename Range::value_type > shark::createDataFromRange (Range const &inputs, std::size_t maximumBatchSize=0)
 creates a data object from a range of elements More...
 
template<class Range >
UnlabeledData< typename boost::range_value< Range >::type > shark::createUnlabeledDataFromRange (Range const &inputs, std::size_t maximumBatchSize=0)
 creates a data object from a range of elements More...
 
template<class Range1 , class Range2 >
LabeledData< typename boost::range_value< Range1 >::type, typename boost::range_value< Range2 >::type > shark::createLabeledDataFromRange (Range1 const &inputs, Range2 const &labels, std::size_t maximumBatchSize=0)
 creates a labeled data object from two ranges, representing inputs and labels More...
 
template<class T , class U >
std::ostream & shark::operator<< (std::ostream &stream, const LabeledData< T, U > &d)
 brief Outstream of elements for labeled data. More...
 
unsigned int shark::numberOfClasses (Data< unsigned int > const &labels)
 Return the number of classes of a set of class labels with unsigned int label encoding. More...
 
std::vector< std::size_t > shark::classSizes (Data< unsigned int > const &labels)
 Returns the number of members of each class in the dataset. More...
 
template<class InputType >
std::size_t shark::dataDimension (Data< InputType > const &dataset)
 Return the dimensionality of a dataset. More...
 
template<class InputType , class LabelType >
std::size_t shark::inputDimension (LabeledData< InputType, LabelType > const &dataset)
 Return the input dimensionality of a labeled dataset. More...
 
template<class InputType , class LabelType >
std::size_t shark::labelDimension (LabeledData< InputType, LabelType > const &dataset)
 Return the label/output dimensionality of a labeled dataset. More...
 
template<class InputType >
std::size_t shark::numberOfClasses (LabeledData< InputType, unsigned int > const &dataset)
 Return the number of classes (highest label value +1) of a classification dataset with unsigned int label encoding. More...
 
template<class InputType , class LabelType >
std::vector< std::size_t > shark::classSizes (LabeledData< InputType, LabelType > const &dataset)
 Returns the number of members of each class in the dataset. More...
 
template<class T , class Functor >
boost::lazy_disable_if< CanBeCalled< Functor, typename Data< T >::batch_type >, TransformedData< Functor, T >>::type shark::transform (Data< T > const &data, Functor f)
 Transforms a dataset using a Functor f and returns the transformed result. More...
 
template<class T , class Functor >
boost::lazy_enable_if< CanBeCalled< Functor, typename Data< T >::batch_type >, TransformedData< Functor, T >>::type shark::transform (Data< T > const &data, Functor const &f)
 Transforms a dataset using a Functor f and returns the transformed result. More...
 
template<class I , class L , class Functor >
LabeledData< typename detail::TransformedDataElement< Functor, I >::type, L > shark::transformInputs (LabeledData< I, L > const &data, Functor const &f)
 Transforms the inputs of a dataset and return the transformed result. More...
 
template<class I , class L , class Functor >
LabeledData< I, typename detail::TransformedDataElement< Functor, L >::type > shark::transformLabels (LabeledData< I, L > const &data, Functor const &f)
 Transforms the labels of a dataset and returns the transformed result. More...
 
template<class T , class FeatureSet >
Data< blas::vector< T > > shark::selectFeatures (Data< blas::vector< T > > const &data, FeatureSet const &features)
 Creates a copy of a dataset selecting only a certain set of features. More...
 
template<class T , class FeatureSet >
LabeledData< RealVector, T > shark::selectInputFeatures (LabeledData< RealVector, T > const &data, FeatureSet const &features)
 
template<class DatasetT >
DatasetT shark::splitAtElement (DatasetT &data, std::size_t elementIndex)
 Removes the last part of a given dataset and returns a new split containing the removed elements. More...
 
template<class I >
void shark::repartitionByClass (LabeledData< I, unsigned int > &data, std::size_t batchSize=LabeledData< I, unsigned int >::DefaultBatchSize)
 reorders the dataset such, that points are grouped by labels More...
 
template<class I >
LabeledData< I, unsigned int > shark::binarySubProblem (LabeledData< I, unsigned int >const &data, unsigned int zeroClass, unsigned int oneClass)
 
template<class I >
LabeledData< I, unsigned int > shark::oneVersusRestProblem (LabeledData< I, unsigned int >const &data, unsigned int oneClass)
 Construct a binary (two-class) one-versus-rest problem from a multi-class problem. More...
 
template<typename RowType >
RowType shark::getColumn (Data< RowType > const &data, std::size_t columnID)
 
template<typename RowType >
void shark::setColumn (Data< RowType > &data, std::size_t columnID, RowType newColumn)
 
template<class T >
std::ostream & shark::operator<< (std::ostream &stream, const Data< T > &d)
 Outstream of elements. More...