Ignore:
Timestamp:
Dec 24, 2009, 2:13:05 AM (13 years ago)
Author:
Peter
Message:

fixes #579

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.5-stable/test/ensemble_test.cc

    r1797 r2132  
    114114  suite.err() << "build ensemble" << std::endl;
    115115  ensemble.build();
     116  utility::Vector out(target.size(),0);
     117  for (size_t i = 0; i<out.size(); ++i) {
     118    out(i)=ensemble.validate()[0][i].mean();
     119  }
     120  statistics::AUC roc;
     121  suite.err() << roc.score(target,out) << std::endl;
     122
    116123  std::vector<std::vector<statistics::Averager> > result;
    117124  ensemble.predict(kernel_lookup, result);
    118  
    119   utility::Vector out(target.size(),0);
    120   for (size_t i = 0; i<out.size(); ++i)
    121     out(i)=ensemble.validate()[0][i].mean();
    122   statistics::AUC roc;
    123   suite.err() << roc.score(target,out) << std::endl;
     125  for (size_t i = 0; i<result.size(); ++i) {
     126    for (size_t j=0; j<result[0].size(); ++j) {
     127      if (!suite.add(result[i][j].variance() > 0)) {
     128        suite.err() << "error: element " << i << " " << j << "\n";
     129        suite.err() << "expected finite prediction varince\n";
     130        suite.err() << "found: " << result[i][j].variance() << "\n";
     131      }
     132    }
     133  }
    124134
    125135  {
Note: See TracChangeset for help on using the changeset viewer.