Changeset 8938:539c5cb1ec37 in orange


Ignore:
Timestamp:
09/09/11 15:32:25 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
a27b987a656ec013eea4b16f2e230e0e4c18f6e9
Message:

Sum the whole continuous distributions in BaggedClassifier.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/ensemble/bagging.py

    r8042 r8938  
    136136                prob = defaultdict(float) 
    137137                for c, p in votes: 
    138                     try:  
    139                         prob[float(c)] += p[c] / wsum 
    140                     except IndexError: # p[c] sometimes fails with index error 
    141                         prob[float(c)] += 1.0 / wsum 
    142                 prob = orange.ContDistribution(prob) 
     138                    for val, val_p in p.items(): 
     139                        prob[float(val)] += val_p / wsum 
     140                     
     141                prob = Orange.statistics.distribution.Continuous(prob) 
    143142                return (self.classVar(pred), prob) if resultType == orange.GetBoth\ 
    144143                    else prob 
Note: See TracChangeset for help on using the changeset viewer.