vFoldCrossVal Class Reference

v-fold cross validation. More...

#include <crossval.h>

Inheritance diagram for vFoldCrossVal:

Inheritance graph
[legend]
Collaboration diagram for vFoldCrossVal:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vFoldCrossVal (UINT v=10, UINT r=0)
 vFoldCrossVal (std::istream &is)
virtual const id_tid () const
virtual vFoldCrossValcreate () const
 Create a new object using the default constructor.
virtual vFoldCrossValclone () const
 Create a new object by replicating itself.
UINT folds () const
void set_folds (UINT v, UINT r=0)
 set the folds and optionally also set the number of rounds

Protected Member Functions

virtual std::vector< REALcv_round () const
virtual bool serialize (std::ostream &, ver_list &) const
virtual bool unserialize (std::istream &, ver_list &, const id_t &=NIL_ID)

Protected Attributes

UINT n_folds

Detailed Description

v-fold cross validation.

Definition at line 92 of file crossval.h.


Constructor & Destructor Documentation

vFoldCrossVal UINT  v = 10,
UINT  r = 0
[inline]
 

Definition at line 94 of file crossval.h.

References vFoldCrossVal::set_folds().

Referenced by vFoldCrossVal::clone(), and vFoldCrossVal::create().

vFoldCrossVal std::istream &  is  )  [inline, explicit]
 

Definition at line 95 of file crossval.h.


Member Function Documentation

virtual vFoldCrossVal* clone  )  const [inline, virtual]
 

Create a new object by replicating itself.

Returns:
A pointer to the new copy.
The code for a derived class Derived is always
 return new Derived(*this); 
Though seemingly redundant, it helps to copy an object without knowing the real type of the object.
See also:
C++ FAQ Lite 20.6

Implements CrossVal.

Definition at line 99 of file crossval.h.

References vFoldCrossVal::vFoldCrossVal().

Referenced by vFoldCrossVal::cv_round().

virtual vFoldCrossVal* create  )  const [inline, virtual]
 

Create a new object using the default constructor.

The code for a derived class Derived is always

 return new Derived(); 

Implements CrossVal.

Definition at line 98 of file crossval.h.

References vFoldCrossVal::vFoldCrossVal().

std::vector< REAL > cv_round  )  const [protected, virtual]
 

using perm[i] is bad for system cache

Implements CrossVal.

Definition at line 147 of file crossval.cpp.

References dataset::append(), vFoldCrossVal::clone(), CrossVal::lm, vFoldCrossVal::n_folds, LearnModel::ptd, CrossVal::set_train_data(), and CrossVal::size().

UINT folds  )  const [inline]
 

Definition at line 101 of file crossval.h.

References vFoldCrossVal::n_folds.

virtual const id_t& id  )  const [virtual]
 

Returns:
Class ID string (class name)

Implements Object.

bool serialize std::ostream &  ,
ver_list
const [protected, virtual]
 

Reimplemented from CrossVal.

Definition at line 134 of file crossval.cpp.

References vFoldCrossVal::n_folds, and SERIALIZE_PARENT.

void set_folds UINT  v,
UINT  r = 0
[inline]
 

set the folds and optionally also set the number of rounds

Definition at line 103 of file crossval.h.

References vFoldCrossVal::n_folds, and CrossVal::set_rounds().

Referenced by vFoldCrossVal::vFoldCrossVal().

bool unserialize std::istream &  ,
ver_list ,
const id_t = NIL_ID
[protected, virtual]
 

Reimplemented from CrossVal.

Definition at line 140 of file crossval.cpp.

References vFoldCrossVal::n_folds, Object::NIL_ID, and UNSERIALIZE_PARENT.


Member Data Documentation

UINT n_folds [protected]
 

Definition at line 109 of file crossval.h.

Referenced by vFoldCrossVal::cv_round(), vFoldCrossVal::folds(), vFoldCrossVal::serialize(), vFoldCrossVal::set_folds(), and vFoldCrossVal::unserialize().


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