Changeset 8005:e9c73a24f4ae in orange


Ignore:
Timestamp:
06/13/11 19:02:45 (3 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
eefae73501d3722968649ee3485a53a1b09e362a
Message:

Fixed a bug in ReliefF that sometimes caused crashing with non-binary classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/measures.cpp

    r7665 r8005  
    11171117      examplesByClasses.at(int((*ei).getClass())).push_back(index); 
    11181118 
     1119    /* 
     1120    This code was removed due to examplesByClasses[neighbourClass].size() later on: 
     1121    since no track is kept on which classes were removed, indexing was misaligned and 
     1122    sometimes caused crashes due to overflow. Instead of this code, classes without examples 
     1123    are skipped (continue in the ITERATE loop below) 
     1124 
    11191125    for(ebcb = examplesByClasses.begin(), ebci = ebcb, ebce = examplesByClasses.end(); ebci != ebce; ) { 
    11201126      const int sze = (*ebci).size(); 
     
    11251131        ebce = examplesByClasses.end(); 
    11261132      } 
    1127     } 
     1133    }*/ 
    11281134  } 
    11291135  else { 
     
    11691175    ITERATE(vector<vector<int> >, cli, examplesByClasses) { 
    11701176      const float inCliClass = (*cli).size(); 
     1177      if (inCliClass==0) 
     1178          continue; 
    11711179      vector<pair<int, float> > distances(inCliClass); 
    11721180      vector<pair<int, float> >::iterator disti = distances.begin(), diste; 
Note: See TracChangeset for help on using the changeset viewer.