ModErn Text Analysis
META Enumerates Textual Applications
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
meta::learn::dataset_view Class Reference

A non-owning view of a dataset. More...

#include <dataset_view.h>

Inheritance diagram for meta::learn::dataset_view:
meta::classify::binary_dataset_view meta::classify::multiclass_dataset_view meta::regression::regression_dataset_view

Classes

class  iterator
 

Public Types

using instance_type = dataset::instance_type
 
using size_type = dataset::size_type
 
using const_iterator = iterator
 

Public Member Functions

 dataset_view (const dataset &dset)
 
 dataset_view (const dataset &dset, dataset::const_iterator begin, dataset::const_iterator end)
 
template<class RandomEngine >
 dataset_view (const dataset &dset, RandomEngine &&rng)
 
template<class RandomEngine >
 dataset_view (const dataset &dset, dataset::const_iterator begin, dataset::const_iterator end, RandomEngine &&rng)
 
 dataset_view (const dataset_view &dv, const_iterator first, const_iterator last)
 
void add_by_index (size_type idx)
 
void shuffle ()
 
void rotate (size_type block_size)
 
iterator begin () const
 
iterator end () const
 
size_type size () const
 
size_type total_features () const
 

Protected Member Functions

 dataset_view (const dataset_view &dv, std::vector< size_type > &&indices)
 
template<class DerivedDataset >
const DerivedDataset & dset () const
 
const std::vector< size_type > indices () const
 

Private Attributes

const datasetdset_
 
std::vector< size_type > indices_
 
random::any_rng rng_
 

Detailed Description

A non-owning view of a dataset.

This is typically what the learning algorithms will see: their own view of a dataset, which they can shuffle/permute as they see fit. Derived classes of dataset_view will typically also define the label value for each element in the dataset that returns something appropriate for that kind of algorithm: +1 or -1 for binary classification, a class_label for multiclass, a double for regression, etc.


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