Changeset 1801:bcc2ac03fb4f in orange-bioinformatics


Ignore:
Timestamp:
05/28/13 15:58:31 (11 months ago)
Author:
markotoplak
Branch:
default
Message:

obiGeneSetSig: data caches get reset at build_features instead of call.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGeneSetSig.py

    r1786 r1801  
    624624    """ 
    625625 
    626     def __call__(self, *args, **kwargs): 
     626    def build_features(self, *args, **kwargs): 
    627627        self.tscorecache = {} #reset a cache 
    628         return super(CORGs, self).__call__(*args, **kwargs) 
     628        return super(CORGs, self).build_features(*args, **kwargs) 
    629629 
    630630    def build_feature(self, data, gs): 
     
    687687 
    688688    def __init__(self, **kwargs): 
    689         self.normalize = kwargs.pop("normalize", False) #normalize final results 
     689        self.normalize = kwargs.pop("normalize", True) #normalize final results 
    690690        super(LLR, self).__init__(**kwargs) 
    691691 
    692     def __call__(self, *args, **kwargs): 
     692    def build_features(self, *args, **kwargs): 
    693693        self._gauss_cache = {} #caching of gaussian estimates 
    694694        self._normalizec = {} 
    695         return super(LLR, self).__call__(*args, **kwargs) 
     695        return super(LLR, self).build_features(*args, **kwargs) 
    696696 
    697697    def build_feature(self, data, gs): 
     
    722722                vals2 = [] 
    723723                for v,g in zip(vals, genes_gs): 
    724                     m,s = self._normalizec[g] 
     724                    m,s = normalizec[g] 
    725725                    vals2.append((v-m)/s) 
    726726                vals = vals2 
    727727             
    728728            return sum(vals) 
    729  
    730729      
    731730        at.get_value_from = t 
     
    832831        super(SPCA_ttperm, self).__init__(**kwargs) 
    833832 
    834     def __call__(self, data, *args, **kwargs): 
     833    def build_features(self, data, *args, **kwargs): 
    835834        joined = [] 
    836835        rand = random.Random(0) 
     
    854853 
    855854        self.threshold = t 
    856         return super(SPCA_ttperm, self).__call__(data, *args, **kwargs) 
     855        return super(SPCA_ttperm, self).build_features(data, *args, **kwargs) 
    857856     
    858857 
     
    888887        print '\n'.join([ a + ": " +str(b) for a,b in ol]) 
    889888 
    890     ass = SPCA(data, matcher=matcher, gene_sets=gsets, class_values=choosen_cv, min_part=0.0, top=0) 
     889    ass = LLR(data, matcher=matcher, gene_sets=gsets, class_values=choosen_cv, min_part=0.0, normalize=True, cv=True) 
    891890    ar = to_old_dic(ass.domain, data[:5]) 
    892891    pp2(ar) 
Note: See TracChangeset for help on using the changeset viewer.