source: trunk/lib/classifier/CrossValidation.h @ 451

Last change on this file since 451 was 451, checked in by Peter, 16 years ago

directory svm -> classifier

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1// $Id: CrossValidation.h 451 2005-12-15 21:09:12Z peter $
2
3#ifndef _theplu_classifier_crossvalidation_
4#define _theplu_classifier_crossvalidation_
5
6#include <vector>
7
8namespace theplu {
9namespace gslapi {
10  class vector;
11}
12namespace classifier { 
13
14  ///
15  /// Class splitting a set into training set and validation set in a
16  /// crossvalidation manner.
17  ///   
18  class CrossValidation
19  {
20 
21  public:
22    ///
23    /// Constructor taking \a target and \a k for k-fold cross validation
24    ///
25    CrossValidation(const theplu::gslapi::vector& target, const size_t k = 3);
26
27    ///
28    /// Function generating a training set. This is done in a balanced
29    /// way, meaning the proportions between the classes the
30    /// trainingset is close to the proportions in the whole
31    /// dataset. In the first \a k rounds each sample is returned k-1
32    /// times, for next round the samples are shuffled and...
33    ///
34    std::vector<size_t> next();
35
36  private:
37    int count_;
38    std::vector<size_t> index_negative_;
39    std::vector<size_t> index_positive_;
40    int k_;
41
42         
43  };
44
45}} // of namespace classifier and namespace theplu
46
47#endif
48
Note: See TracBrowser for help on using the repository browser.