Changeset 1775:023037d1e29a in orange-bioinformatics


Ignore:
Timestamp:
05/08/13 16:45:58 (11 months ago)
Author:
markotoplak
Branch:
default
Message:

obiGeneSetSig: LLR uses combined standard deviation if a standard deviation for a class was zero (this can happen as an artifict of bootstrap sampling).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGeneSetSig.py

    r1774 r1775  
    135135            return 0 
    136136 
    137 def estimate_gaussian_per_class(data, i, a=None, b=None): 
     137def estimate_gaussian_per_class(data, i, a=None, b=None, common_if_extreme=False): 
    138138    cv = data.domain.class_var 
    139139 
     
    160160    except: 
    161161        pass 
     162 
     163    def extreme(): 
     164        return st1 == 0 or st2 == 0 
    162165     
     166    if common_if_extreme and extreme(): 
     167        print "extreme", st1, st2, 
     168        st1 = st2 = statc.std(list1 + list2) 
     169        print "new", st1, st2 
     170 
    163171    return mi1, st1, mi2, st2 
    164172 
     
    647655        """ Cached attribute  tscore calculation """ 
    648656        if cache != None and at in cache: return cache[at] 
    649         ma = estimate_gaussian_per_class(data, at) 
     657        ma = estimate_gaussian_per_class(data, at, common_if_extreme=True) 
    650658        if cache != None: cache[at] = ma 
    651659        return ma 
Note: See TracChangeset for help on using the changeset viewer.