Changeset 10140:5803cc112b09 in orange


Ignore:
Timestamp:
02/08/12 18:47:26 (2 years ago)
Author:
ales_erjavec
Branch:
default
rebase_source:
1c85ed9b0c7630a775315d1c070cc265dd139426
Message:

Some minor code cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/regression/earth.py

    r10131 r10140  
    175175         
    176176    def __call__(self, instances, weight_id=None): 
    177         original_domain = instances.domain # Needed by classifier and evimp 
    178177        instances = self.preproc(instances) 
    179178        expanded_class = None 
     
    505504    """ Do earth forward pass. 
    506505    """ 
    507     import ctypes, orange 
    508506    x = numpy.asfortranarray(x, dtype=ctypes.c_double) 
    509507    y = numpy.asfortranarray(y, dtype=ctypes.c_double) 
     
    624622    Y = numpy.asarray(Y) 
    625623     
    626     var_count= X.shape[1] 
     624    var_count = X.shape[1] 
    627625    rss_vec = numpy.zeros(var_count) 
    628626    working_set = range(var_count) 
     
    720718    """ Return a formated string representation of the earth model. 
    721719    """ 
    722     mask = model.label_mask 
    723720    if model.multi_flag: 
    724721        r_vars = [v for v, m in zip(model.domain.variables, 
     
    901898    imp = numpy.array(imp) 
    902899    X = range(len(attrs)) 
    903     l1 = axes1.plot(X, imp[:,0], "b-",) 
     900    l1 = axes1.plot(X, imp[:, 0], "b-",) 
    904901    axes2 = axes1.twinx() 
    905902     
    906     l2 = axes2.plot(X, imp[:,1], "g-",) 
    907     l3 = axes2.plot(X, imp[:,2], "r-",) 
     903    l2 = axes2.plot(X, imp[:, 1], "g-",) 
     904    l3 = axes2.plot(X, imp[:, 2], "r-",) 
    908905     
    909906    x_axis = axes1.xaxis 
     
    932929        if not isinstance(object, class_): 
    933930            raise TypeError("Instance of %r expected." % (class_)) 
    934     from collections import defaultdict 
     931     
    935932    from Orange.ensemble.bagging import BaggedClassifier 
    936933     
     
    950947     
    951948     
    952     bagged_imp = sorted(bagged_imp.items(), key=lambda t: (t[1][0],t[1][1]), 
     949    bagged_imp = sorted(bagged_imp.items(), 
     950                        key=lambda t: (t[1][0], t[1][1]), 
    953951                        reverse=True) 
    954952     
     
    10161014        self.cached = cached 
    10171015        self._cache_ref = None 
     1016        self._cached_evimp = None 
    10181017         
    10191018    def __call__(self, attr, data, weight_id=None): 
Note: See TracChangeset for help on using the changeset viewer.