Changeset 2697


Ignore:
Timestamp:
Feb 28, 2012, 5:02:29 PM (11 years ago)
Author:
Peter
Message:

use nan to flag that area is not updated rather than -1 as before since the actual area can be -1 as we allow negative weights

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/ROC.cc

    r2696 r2697  
    5757    else
    5858      w_neg_+=w;
    59     area_=-1;
     59    area_ = std::numeric_limits<double>::quiet_NaN();
    6060  }
    6161
     
    6363  double ROC::area(void)
    6464  {
    65     if (area_==-1){
     65    if (std::isnan(area_)){
    6666      AUC auc(false);
    6767      area_=auc.score(multimap_);
     
    147147  {
    148148    double area(area_);
    149     if (area_==-1){
     149    if (std::isnan(area)){
    150150      AUC auc(false);
    151151      area = auc.score(multimap_);
     
    173173  {
    174174    double area(area_);
    175     if (area_==-1){
     175    if (std::isnan(area)){
    176176      AUC auc(false);
    177177      area = auc.score(multimap_);
     
    187187  void ROC::reset(void)
    188188  {
    189     area_=-1;
     189    area_ = std::numeric_limits<double>::quiet_NaN();
    190190    has_ties_ = false;
    191191    w_pos_=0;
Note: See TracChangeset for help on using the changeset viewer.