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
|
Rev | Line | |
---|
[151] | 1 | // $Id: inputranker_test.cc 453 2005-12-15 21:49:23Z peter $ |
---|
| 2 | |
---|
[453] | 3 | #include <c++_tools/classifier/InputRanker.h> |
---|
[301] | 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] | 11 | using namespace theplu; |
---|
[151] | 12 | |
---|
| 13 | int 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; |
---|
[453] | 24 | classifier::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.