Ignore:
Timestamp:
09/28/12 15:38:28 (19 months ago)
Author:
Janez Demšar <janez.demsar@…>
Branch:
default
Message:

Fixed a bug in TTreeSplitConstructor_ExhaustiveBinary: invalid selection of the best split

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/tdidt_split.cpp

    r7993 r10992  
    449449            *dis1 *= 0; 
    450450            vector<int>::const_iterator ii(valueIndices.begin()); 
     451            ii++; 
    451452            for(TBoolCount::const_iterator bi(selection.begin()), be(selection.end()); bi!=be; bi++, ii++) 
    452453               *(*bi ? dis1 : dis0) += distr[*ii]; 
    453  
    454             if ((dis0->abs<minSubset) || (dis1->abs<minSubset)) 
     454            cont->outerDistribution->setint(0, dis0->abs); 
     455            cont->outerDistribution->setint(1, dis1->abs); 
     456 
     457            if ((dis0->abs < minSubset) || (dis1->abs < minSubset)) 
    455458              continue; // cannot split like that, to few examples in one of the branches 
    456459 
     
    499502          vector<int>::const_iterator ii = valueIndices.begin(); 
    500503          bestMapping->at(*(ii++)) = 0; 
    501           ITERATE(TBoolCount, bi, selection) 
     504          ITERATE(TBoolCount, bi, bestSelection) 
    502505            bestMapping->at(*(ii++)) = *bi ? 1 : 0; 
    503506        } 
Note: See TracChangeset for help on using the changeset viewer.