source: trunk/test/test_crossvalidation.cc @ 116

Last change on this file since 116 was 116, checked in by Peter, 18 years ago

test_crossvalidation and test_statistics added

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 742 bytes
Line 
1// $Id: test_crossvalidation.cc 116 2004-07-19 14:40:11Z peter $
2
3// C++ tools include
4////////////////////
5#include "CrossValidation.h"
6
7// Standard includes
8////////////////////
9#include <vector>
10#include <cstdlib>
11#include <iostream>
12
13using namespace std;
14
15int main()
16{ 
17  theplu::cpptools::CrossValidation cv(10);
18  std::vector<size_t> training_set;
19
20  std::vector<size_t> count(10);
21
22  training_set = cv.next();
23  for (unsigned int i=0; i<training_set.size(); i++) 
24    count[training_set[i]]++;
25 
26  training_set = cv.next();
27  for (unsigned int i=0; i<training_set.size(); i++) 
28    count[training_set[i]]++;
29
30  training_set = cv.next();
31  for (unsigned int i=0; i<training_set.size(); i++) 
32    count[training_set[i]]++;
33
34  for (unsigned int i=0; i<10 ; i++) 
35    if (count[i]!=2)
36      return -1;
37
38  return 0;
39}
Note: See TracBrowser for help on using the repository browser.