Changeset 554


Ignore:
Timestamp:
Mar 7, 2006, 3:22:29 PM (16 years ago)
Author:
Markus Ringnér
Message:

added small test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/crossvalidation_test.cc

    r551 r554  
    145145      }     
    146146
     147      std::vector<size_t> tv_sample_count(6,0);
    147148      for (size_t i=0; i<t_index.size(); i++) {
    148149        assert(t_index[i]<t_sample_count.size());
     150        tv_sample_count[t_index[i]]++;
    149151        t_sample_count[t_index[i]]++;
    150152        t_class_count[t_target(i)]++;
    151153        t_class_count2[tv_target(t_index[i])]++;
    152154        t_value[0]+=t_view(0,i);
    153         t_value[t_target(i)+1]+=t_view(0,i);
     155        t_value[t_target(i)+1]+=t_view(0,i);       
    154156      }
    155157      for (size_t i=0; i<v_index.size(); i++) {
    156158        assert(v_index[i]<v_sample_count.size());
     159        tv_sample_count[v_index[i]]++;
    157160        v_sample_count[v_index[i]]++;
    158161        v_class_count[v_target(i)]++;
     
    160163        v_value[v_target(i)+1]+=v_view(0,i);
    161164      }
     165 
     166      sample_count_test(tv_sample_count,error,ok);     
    162167
    163168      cv_training.next();     
     
    240245    if (sample_count[i]!=1){
    241246      ok = false;
    242       *error << "ERROR: sample " << i << " was validated " << sample_count[i]
     247      *error << "ERROR: sample " << i << " was in a group " << sample_count[i]
    243248             << " times." << " Expected to be 1 time" << std::endl;
    244249    }
Note: See TracChangeset for help on using the changeset viewer.