Changeset 5055:07ca18d090e1 in orange


Ignore:
Timestamp:
08/02/08 16:20:05 (6 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
185934159260402e8911ae004c0b1a3374cbdd7c
Message:
  • fixed a division by zero
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/orngContingency.py

    r4795 r5055  
    1818 
    1919 
    20 import numpy, orange 
     20import numpy, orange, statc 
    2121from random import * 
    2222 
     
    220220        return (ptrue,pkirkwood,_log2*div) 
    221221 
     222    def ChiSquareP(self): 
     223        E = numpy.outer(self.pa, self.pb) * self.total 
     224        return statc.chisqprob(numpy.sum((E-self.m)**2 / E.clip(min=0.000001)), (len(self.pa)-1)*(len(self.pb)-1)) 
     225#        return numpy.sum((E-self.m)**2 / E) 
     226       
    222227    def Bootstrap(self,N,limit): 
    223228        # prepare lookup 
Note: See TracChangeset for help on using the changeset viewer.