Changeset 2549


Ignore:
Timestamp:
Aug 12, 2011, 3:03:52 AM (10 years ago)
Author:
Peter
Message:

ROC: adding a test for ties case. refs #144

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/roc.cc

    r2370 r2549  
    33/*
    44  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2011 Peter Johansson
    56
    67  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    3435
    3536using namespace theplu::yat;
     37
     38void test_ties(test::Suite& suite);
    3639
    3740int main(int argc, char* argv[])
     
    9295  classifier::DataLookupWeighted1D dlw(target.size(),1.3);
    9396  add(roc, dlw.begin(), dlw.end(), target);
    94 
     97  test_ties(suite);
     98 
    9599  return suite.return_value();
    96100}
     101
     102void test_ties(test::Suite& suite)
     103{
     104  suite.out() << "test ties\n";
     105  statistics::ROC roc;
     106  for (size_t i=0; i<20; ++i)
     107    roc.add(10.0, i<10);
     108  if (!suite.xadd(suite.equal(roc.area(), 0.5))) {
     109    suite.err() << "error: roc with ties: area: " << roc.area() << "\n";
     110  }
     111}
Note: See TracChangeset for help on using the changeset viewer.