class KFold

Provides an interface to sample data, for use by methods such as cross-validation

Inheritance:


Public Fields

[more]int** train_subsets
Training examples for each fold
[more]int** test_subsets
Test examples for each fold
[more]int* n_train_subsets
Number of training examples for each fold
[more]int* n_test_subsets
Number of test examples for each fold

Public Methods

[more] KFold(Trainer* trainer_, int kfold_)
[more]virtual void crossValidate(DataSet* data, MeasurerList* train_measurers=NULL, MeasurerList* test_measurers=NULL, MeasurerList* cross_valid_measurers=NULL)
Do a cross-validation over data.
[more]virtual void sample(int n_examples)
Prepare the sample.


Inherited from Object:

Public Fields

oAllocator* allocator

Public Methods

ovoid addOption(const char* name, int size, void* ptr, const char* help="")
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="")
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="")
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
ovoid addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
ovoid setOption(const char* name, void* ptr)
ovoid setIOption(const char* name, int option)
ovoid setROption(const char* name, real option)
ovoid setBOption(const char* name, bool option)
ovoid setOOption(const char* name, Object* option)
ovirtual void loadXFile(XFile* file)
ovirtual void saveXFile(XFile* file)
ovoid load(const char* filename)
ovoid save(const char* filename)
ovoid* operator new(size_t size, Allocator* allocator_=NULL)
ovoid* operator new(size_t size, Allocator* allocator_, void* ptr_)
ovoid operator delete(void* ptr)


Documentation

Provides an interface to sample data, for use by methods such as cross-validation

oint** train_subsets
Training examples for each fold

oint** test_subsets
Test examples for each fold

oint* n_train_subsets
Number of training examples for each fold

oint* n_test_subsets
Number of test examples for each fold

o KFold(Trainer* trainer_, int kfold_)

ovirtual void crossValidate(DataSet* data, MeasurerList* train_measurers=NULL, MeasurerList* test_measurers=NULL, MeasurerList* cross_valid_measurers=NULL)
Do a cross-validation over data. train_measurers are called in each "train pass" for each fold. test_measurers are called in each "test pass" for each fold. cross_valid_measurers are called during the cross-validation loop.

ovirtual void sample(int n_examples)
Prepare the sample. Given n_examples, puts the right examples-indices in train_subsets and test_subsets, and updates n_train_subsets and n_test_subsets. (You don't have to allocate these arrays). The provided sample function is a standard sample for cross-validation, but you could imagine what you want!


This class has no child classes.
Author:
Samy Bengio (bengio@idiap.ch) Ronan Collobert (collober@idiap.ch)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.