Changeset 156
- Timestamp:
- Sep 10, 2004, 3:34:43 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/test_roc.cc
r151 r156 61 61 62 62 theplu::gslapi::vector correct_area(3); 63 correct_area(0)= 1.0;64 correct_area(1)= 0.75;65 correct_area(2)= 0.50;63 correct_area(0)=8.0/9.0; 64 correct_area(1)=6.0/9.0; 65 correct_area(2)=1.0; 66 66 67 const double tol = 0.001; 67 68 for (size_t i=0; i<data.rows(); i++){ 68 69 theplu::gslapi::vector vec = data[i]; 69 70 area = roc.score(target2,vec); 70 if (area !=correct_area(i)){71 if (area<correct_area(i)-tol || area>correct_area(i)+tol){ 71 72 cerr << "test_roc: area is " << area << " should be " 72 73 << correct_area(i) << endl; … … 75 76 } 76 77 78 theplu::gslapi::vector weight(target2.size(),1); 79 for (size_t i=0; i<data.rows(); i++){ 80 theplu::gslapi::vector vec = data[i]; 81 area = roc.score(target2, vec, weight); 82 if (area<correct_area(i)-tol || area>correct_area(i)+tol){ 83 cerr << "test_roc: weighted area is " << area << " should be " 84 << correct_area(i) << endl; 85 return -1; 86 } 87 } 88 89 77 90 if (ok) 78 91 return 0;
Note: See TracChangeset
for help on using the changeset viewer.