HoldoutCrossVal Class Reference

Randomized holdout cross-validation. More...

#include <crossval.h>

Inheritance diagram for HoldoutCrossVal:

Inheritance graph
[legend]
Collaboration diagram for HoldoutCrossVal:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 HoldoutCrossVal (REAL p=1.0/6, UINT r=0)
 HoldoutCrossVal (std::istream &is)
virtual const id_tid () const
virtual HoldoutCrossValcreate () const
 Create a new object using the default constructor.
virtual HoldoutCrossValclone () const
 Create a new object by replicating itself.
REAL holdout () const
void set_holdout (REAL p, UINT r=0)
 set the holdout portion and optionally set the number of rounds

Protected Member Functions

virtual std::vector< REALcv_round () const
 one round of the cross-validation operation
virtual bool serialize (std::ostream &, ver_list &) const
virtual bool unserialize (std::istream &, ver_list &, const id_t &=NIL_ID)

Protected Attributes

REAL p_test

Detailed Description

Randomized holdout cross-validation.

Definition at line 118 of file crossval.h.


Constructor & Destructor Documentation

HoldoutCrossVal REAL  p = 1.0/6,
UINT  r = 0
[inline]
 

Definition at line 120 of file crossval.h.

References HoldoutCrossVal::set_holdout().

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

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

Definition at line 121 of file crossval.h.


Member Function Documentation

virtual HoldoutCrossVal* 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 125 of file crossval.h.

References HoldoutCrossVal::HoldoutCrossVal().

virtual HoldoutCrossVal* 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 124 of file crossval.h.

References HoldoutCrossVal::HoldoutCrossVal().

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

one round of the cross-validation operation

Implements CrossVal.

Definition at line 203 of file crossval.cpp.

References dataset::append(), HoldoutCrossVal::p_test, LearnModel::ptd, and randu.

REAL holdout  )  const [inline]
 

Definition at line 128 of file crossval.h.

References HoldoutCrossVal::p_test.

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 190 of file crossval.cpp.

References HoldoutCrossVal::p_test, and SERIALIZE_PARENT.

void set_holdout REAL  p,
UINT  r = 0
[inline]
 

set the holdout portion and optionally set the number of rounds

Definition at line 130 of file crossval.h.

References HoldoutCrossVal::p_test, and CrossVal::set_rounds().

Referenced by HoldoutCrossVal::HoldoutCrossVal().

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

Reimplemented from CrossVal.

Definition at line 196 of file crossval.cpp.

References Object::NIL_ID, HoldoutCrossVal::p_test, and UNSERIALIZE_PARENT.


Member Data Documentation

REAL p_test [protected]
 

Definition at line 136 of file crossval.h.

Referenced by HoldoutCrossVal::cv_round(), HoldoutCrossVal::holdout(), HoldoutCrossVal::serialize(), HoldoutCrossVal::set_holdout(), and HoldoutCrossVal::unserialize().


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