Last change
on this file since 453 was
453,
checked in by Peter, 17 years ago
|
changed namespace svm to classifier in test
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
699 bytes
|
Line | |
---|
1 | // $Id: inputranker_test.cc 453 2005-12-15 21:49:23Z peter $ |
---|
2 | |
---|
3 | #include <c++_tools/classifier/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 | |
---|
11 | using namespace theplu; |
---|
12 | |
---|
13 | int 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 | classifier::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.