dataset Class Template Reference

Class template for storing, retrieving, and manipulating a vector of input-output style data. More...

#include <dataset.h>

Collaboration diagram for dataset:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Tx x_type
typedef Ty y_type

Public Member Functions

 dataset ()
datasetoperator+= (const dataset &ds)
 Combine two data sets.
void append (const Tx &_x, const Ty &_y)
void replace (UINT i, const Tx &_x, const Ty &_y)
UINT size () const
bool empty () const
void clear ()
const Tx & x (UINT i) const
const Ty & y (UINT i) const
template<typename IIX, typename IIY>
 dataset (IIX xb, IIX xe, IIY yb, IIY ye)
template<typename IIX, typename IIY>
void import (IIX xb, IIX xe, IIY yb, IIY ye)
 Import data from other types.
datasetrandom_sample (UINT n) const
 Generate a randomly sampled copy of the data set.
template<typename W>
datasetrandom_sample (const W &wgt, UINT n) const

Detailed Description

template<typename Tx, typename Ty>
class lemga::dataset< Tx, Ty >

Class template for storing, retrieving, and manipulating a vector of input-output style data.

Parameters:
Tx Type of input x.
Ty Type of output y.
What we want are: 1. a place to store data 2. be able to deal with missing feature?

Member functions:

Todo:
documentation

Definition at line 36 of file dataset.h.


Member Typedef Documentation

typedef Tx x_type
 

Definition at line 47 of file dataset.h.

typedef Ty y_type
 

Definition at line 48 of file dataset.h.


Constructor & Destructor Documentation

dataset  )  [inline]
 

Definition at line 50 of file dataset.h.

dataset IIX  xb,
IIX  xe,
IIY  yb,
IIY  ye
[inline]
 

Definition at line 62 of file dataset.h.


Member Function Documentation

void append const Tx &  _x,
const Ty &  _y
[inline]
 

Definition at line 156 of file dataset.h.

Referenced by HoldoutCrossVal::cv_round(), vFoldCrossVal::cv_round(), Ordinal_BLE::extend_data(), lemga::load_data(), DataFeeder::next_train_test(), AdaBoost_ECOC::train_with_full_partition(), AdaBoost_ERP::train_with_partial_partition(), and MultiClass_ECOC::train_with_partition().

void clear  )  [inline]
 

Definition at line 55 of file dataset.h.

bool empty  )  const [inline]
 

Definition at line 54 of file dataset.h.

void import IIX  xb,
IIX  xe,
IIY  yb,
IIY  ye
[inline]
 

Import data from other types.

Parameters:
IIX stands for Input Iterator for x.
IIY stands for Input Iterator for y.
import() copies input x from range [xb, xe) and output y from range [yb, ye). Old data stored in the set will be erased.

To import data from two vectors vx and vy, use

 import(vx.begin(), vx.end(), vy.begin(), vy.end()); 
To import n samples from two pointers px and py, use
 import(px, px+n, py, py+n); 

Definition at line 78 of file dataset.h.

dataset& operator+= const dataset< Tx, Ty > &  ds  )  [inline]
 

Combine two data sets.

Note:
Code
 copy(ds.d.begin(), ds.d.end(), back_inserter(d)); 
does almost the same thing, but will fail when ds is just *this. That is,
 ds += ds; 
doesn't work.
Todo:
We need more functions to add/remove samples.

Definition at line 148 of file dataset.h.

References dataset::d.

dataset* random_sample const W &  wgt,
UINT  n
const [inline]
 

Generate a randomly sampled copy of the data set.

Parameters:
n Number of random samples requested.
Returns:
A pointer to the new born data set.
Samples are chosen with uniform probability.
Parameters:
W Sample weight type, which usually is vector<REAL>. W should support operator[].
wgt Sample weight.

Definition at line 113 of file dataset.h.

References dataset::d, EPSILON, and randu.

dataset* random_sample UINT  n  )  const [inline]
 

Generate a randomly sampled copy of the data set.

Parameters:
n Number of random samples requested.
Returns:
A pointer to the new born data set.
Samples are chosen with uniform probability.

Definition at line 93 of file dataset.h.

References dataset::d, and randu.

void replace UINT  i,
const Tx &  _x,
const Ty &  _y
[inline]
 

Definition at line 163 of file dataset.h.

Referenced by DataFeeder::linear_scale().

UINT size  )  const [inline]
 

Definition at line 53 of file dataset.h.

Referenced by LearnModel::exact_dimensions(), DataFeeder::linear_scale(), lemga::load_data(), DataFeeder::mean_var(), and DataFeeder::min_max().

const Tx& x UINT  i  )  const [inline]
 

Definition at line 56 of file dataset.h.

Referenced by LearnModel::exact_dimensions(), DataFeeder::linear_scale(), DataFeeder::mean_var(), DataFeeder::min_max(), and LearnModel::set_dimensions().

const Ty& y UINT  i  )  const [inline]
 

Definition at line 57 of file dataset.h.

Referenced by LearnModel::exact_dimensions(), DataFeeder::linear_scale(), and LearnModel::set_dimensions().


The documentation for this class was generated from the following file:
Generated on Wed Nov 8 08:16:55 2006 for LEMGA by  doxygen 1.4.6