source: trunk/test/inputranker_test.cc @ 301

Last change on this file since 301 was 301, checked in by Peter, 17 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
RevLine 
[151]1// $Id: inputranker_test.cc 301 2005-04-30 13:39:27Z peter $
2
[301]3#include <c++_tools/svm/InputRanker.h>
4#include <c++_tools/statistics/ROC.h>
5#include <c++_tools/gslapi/matrix.h>
[151]6
7#include <cstdlib>
8#include <fstream>
9#include <iostream>
10
[301]11using namespace theplu;
[151]12
13int main()
14{ 
[301]15  std::ifstream is("data/rank_data.txt");
16  gslapi::matrix data(is);
[151]17  is.close();
18
19  is.open("data/rank_target.txt");
20  theplu::gslapi::vector target(is);
21  is.close();
22
[301]23  statistics::ROC roc;
24  svm::InputRanker ir(data,target,roc);
[151]25
26  if (ir.id(0)!=2 || ir.id(1)!=0 || ir.id(2)!=1){
[301]27    std::cerr << "wrong id" << std::endl;
[151]28    return -1;
29  }
30 
31  if (ir.rank(0)!=1 || ir.rank(1)!=2 || ir.rank(2)!=0){
[301]32    std::cerr << "wrong rank" << std::endl;
[151]33    return -1;
34  }
35 
36  return 0;
37}
Note: See TracBrowser for help on using the repository browser.