Changeset 1723:753e1d554488 in orange-bioinformatics


Ignore:
Timestamp:
10/25/12 05:58:22 (18 months ago)
Author:
markotoplak
Branch:
default
Message:

SetSig uses statc for pearsonr. Around 10x speedup compared to numpy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGeneSetSig.py

    r1711 r1723  
    297297            vals2 = [ v for v,c in zip(vals2, common) if c ] 
    298298 
    299         return numpy.corrcoef([vals1, vals2])[0,1] 
     299        #statc correlation is from 5-10 times faster than numpy! 
     300        try: 
     301            return statc.pearsonr(vals1, vals2)[0] 
     302        except: 
     303            return numpy.corrcoef([vals1, vals2])[0,1]  
     304         
    300305 
    301306    def ttest(ex1, ex2): 
Note: See TracChangeset for help on using the changeset viewer.