source: trunk/test/inputranker_test.cc @ 301

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

modified includes in tests

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 685 bytes
Line 
1// $Id: inputranker_test.cc 301 2005-04-30 13:39:27Z peter $
2
3#include <c++_tools/svm/InputRanker.h>
4#include <c++_tools/statistics/ROC.h>
5#include <c++_tools/gslapi/matrix.h>
6
7#include <cstdlib>
8#include <fstream>
9#include <iostream>
10
11using namespace theplu;
12
13int main()
14{ 
15  std::ifstream is("data/rank_data.txt");
16  gslapi::matrix data(is);
17  is.close();
18
19  is.open("data/rank_target.txt");
20  theplu::gslapi::vector target(is);
21  is.close();
22
23  statistics::ROC roc;
24  svm::InputRanker ir(data,target,roc);
25
26  if (ir.id(0)!=2 || ir.id(1)!=0 || ir.id(2)!=1){
27    std::cerr << "wrong id" << std::endl;
28    return -1;
29  }
30 
31  if (ir.rank(0)!=1 || ir.rank(1)!=2 || ir.rank(2)!=0){
32    std::cerr << "wrong rank" << std::endl;
33    return -1;
34  }
35 
36  return 0;
37}
Note: See TracBrowser for help on using the repository browser.