Ignore:
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Orange/misc/counters.py

    r9671 r9871  
    66.. index:: misc 
    77.. index:: 
    8    single: misc; counters 
     8     single: misc; counters 
     9 
     10:class:`Orange.misc.counters` contains a bunch of classes that generate sequences of various kinds. 
     11 
    912""" 
    1013 
    1114class BooleanCounter: 
    12   def __init__(self, bits): 
    13     self.bits = bits 
    14     self.state = None 
    15  
    16   def __iter__(self): 
    17     if self.state: 
    18         return self 
    19     else: 
    20         return BooleanCounter(self.bits) 
    21      
    22   def next(self): 
    23     if self.state: 
    24       for bit in range(self.bits-1, -1, -1): 
    25         self.state[bit] = (self.state[bit]+1) % 2 
    26         if self.state[bit]: 
    27           break 
    28       else: 
     15    """ 
     16    A class which represents a boolean counter. The constructor is given the number of bits and during the 
     17    iteration the counter returns a list of that length with 0 and 1's in it. 
     18 
     19    One way to use the counter is within a for-loop: 
     20 
     21    >>> for r in Orange.misc.counters.BooleanCounter(3): 
     22    ...    print r 
     23    [0, 0, 0] 
     24    [0, 0, 1] 
     25    [0, 1, 0] 
     26    [0, 1, 1] 
     27    [1, 0, 0] 
     28    [1, 0, 1] 
     29    [1, 1, 0] 
     30    [1, 1, 1] 
     31 
     32    You can also call it manually. 
     33 
     34    >>> r = Orange.misc.counters.BooleanCounter(3) 
     35    >>> r.next() 
     36    [0, 0, 0] 
     37    >>> r.next() 
     38    [0, 0, 1] 
     39    >>> r.next() 
     40    [0, 1, 0] 
     41 
     42    .. attribute:: state 
     43     
     44        The current counter state (the last result of a call to next) is also stored as attribute attribute. 
     45 
     46    """ 
     47     
     48    def __init__(self, bits): 
     49        """ 
     50            :param bits: Number of bits. 
     51            :type bits: int 
     52        """ 
     53        self.bits = bits 
    2954        self.state = None 
    30     else: 
    31       self.state = [0]*self.bits 
    32  
    33     if not self.state: 
    34         raise StopIteration, "BooleanCounter: counting finished" 
    35  
    36     return self.state 
    37  
     55 
     56    def __iter__(self): 
     57        if self.state: 
     58            return self 
     59        else: 
     60            return BooleanCounter(self.bits) 
     61         
     62    def next(self): 
     63        """Return the next state of the counter.""" 
     64        if self.state: 
     65            for bit in range(self.bits-1, -1, -1): 
     66                self.state[bit] = (self.state[bit]+1) % 2 
     67                if self.state[bit]: 
     68                    break 
     69            else: 
     70                self.state = None 
     71        else: 
     72            self.state = [0]*self.bits 
     73        if not self.state: 
     74            raise StopIteration, "BooleanCounter: counting finished" 
     75        return self.state 
    3876 
    3977class LimitedCounter: 
    40   def __init__(self, limits): 
    41     self.limits = limits 
    42     self.state = None 
    43      
    44   def __iter__(self): 
    45     if self.state: 
    46         return self 
    47     else: 
    48         return LimitedCounter(self.limits) 
    49  
    50   def next(self): 
    51     if self.state: 
    52       i = len(self.limits)-1 
    53       while (i>=0) and (self.state[i]==self.limits[i]-1): 
    54         self.state[i] = 0 
    55         i -= 1 
    56       if i==-1: 
     78    """ 
     79    This class is similar to :class:`~Orange.misc.counters.BooleanCounter` except that the digits do not count 
     80    from 0 to 1, but to the limits that are specified individually for each digit. 
     81 
     82    >>> for t in Orange.misc.counters.LimitedCounter([3, 5, 2]): 
     83    ...     print t 
     84    [0, 0, 0] 
     85    [0, 0, 1] 
     86    [0, 1, 0] 
     87    [0, 1, 1] 
     88    [0, 2, 0] 
     89    [0, 2, 1] 
     90    [0, 3, 0] 
     91    [0, 3, 1] 
     92    [0, 4, 0] 
     93    [0, 4, 1] 
     94    [1, 0, 0] 
     95    [1, 0, 1] 
     96    [1, 1, 0] 
     97    [1, 1, 1] 
     98 
     99    .. attribute:: state 
     100 
     101        The current counter state (the last result of a call to next) is also stored as attribute attribute. 
     102    """ 
     103     
     104    def __init__(self, limits): 
     105        """ 
     106            :param limits: Domain size per bit position. 
     107            :type limits: list 
     108        """ 
     109        self.limits = limits 
    57110        self.state = None 
    58       else: 
    59         self.state[i] += 1 
    60     else: 
    61       self.state = [0]*len(self.limits) 
    62    
    63     if not self.state: 
    64       raise StopIteration, "LimitedCounter: counting finished" 
    65  
    66     return self.state 
    67  
     111         
     112    def __iter__(self): 
     113        if self.state: 
     114            return self 
     115        else: 
     116            return LimitedCounter(self.limits) 
     117 
     118    def next(self): 
     119        """Return the next state of the counter.""" 
     120        if self.state: 
     121            i = len(self.limits)-1 
     122            while (i>=0) and (self.state[i]==self.limits[i]-1): 
     123                self.state[i] = 0 
     124                i -= 1 
     125            if i==-1: 
     126                self.state = None 
     127            else: 
     128                self.state[i] += 1 
     129        else: 
     130            self.state = [0]*len(self.limits) 
     131     
     132        if not self.state: 
     133            raise StopIteration, "LimitedCounter: counting finished" 
     134 
     135        return self.state 
    68136 
    69137class MofNCounter: 
     138    """ 
     139    Counter returns all consecutive subset lists of length ``m`` out of ``n`` where ``m`` <= ``n``. 
     140 
     141    >>> for t in Orange.misc.counters.MofNCounter(3,7): 
     142    ...     print t 
     143    ... 
     144    [0, 1, 2] 
     145    [1, 2, 3] 
     146    [2, 3, 4] 
     147    [3, 4, 5] 
     148    [4, 5, 6] 
     149 
     150    .. attribute:: state 
     151 
     152        The current counter state (the last result of a call to next) is also stored as attribute attribute. 
     153    """ 
     154     
    70155    def __init__(self, m, n): 
     156        """ 
     157        :param m: Length of subset list. 
     158        :type m: int 
     159 
     160        :param n: Total length. 
     161        :type n: int 
     162        """ 
    71163        if m > n: 
    72164            raise TypeError, "Number of selected items exceeds the number of items" 
    73          
     165                 
    74166        self.state = None 
    75167        self.m = m 
    76168        self.n = n 
    77          
     169                 
    78170    def __iter__(self): 
    79171        if self.state: 
     
    81173        else: 
    82174            return MofNCounter(self.m, self.n) 
    83          
    84     def next(self): 
     175                 
     176    def next(self): 
     177        """Return the next state of the counter.""" 
    85178        if self.state: 
    86179            m, n, state = self.m, self.n, self.state 
     
    90183                    for place in range(place+1, m): 
    91184                        state[place] = state[place-1] + 1 
    92                     break 
     185                        break 
     186                else: 
     187                    self.state = None 
     188                    raise StopIteration, "MofNCounter: counting finished" 
     189        else: 
     190            self.state = range(self.m) 
     191        return self.state[:] 
     192                          
     193class NondecreasingCounter: 
     194    """ 
     195    Nondecreasing counter generates all non-decreasing integer sequences in which no numbers are skipped, 
     196    that is, if n is in the sequence, the sequence also includes all numbers between 0 and n. For instance, 
     197    [0, 0, 1, 0] is illegal since it decreases, and [0, 0, 2, 2] is illegal since it has 2 without having 1 
     198    first. Or, with an example 
     199 
     200    Nondecreasing counter generates all non-decreasing integer sequences in which no numbers are skipped, 
     201    that is, if ``n`` is in the sequence, the sequence also includes all numbers between 0 and ``n``. For instance, 
     202    [0, 0, 1, 0] is illegal since it decreases, and [0, 0, 2, 2] is illegal since it has 2 without having 1 first. 
     203    Or, with an example 
     204 
     205    >>> for t in Orange.misc.counters.NondecreasingCounter(4): 
     206    ...     print t 
     207    ... 
     208    [0, 0, 0, 0] 
     209    [0, 0, 0, 1] 
     210    [0, 0, 1, 1] 
     211    [0, 0, 1, 2] 
     212    [0, 1, 1, 1] 
     213    [0, 1, 1, 2] 
     214    [0, 1, 2, 2] 
     215    [0, 1, 2, 3] 
     216 
     217    .. attribute:: state 
     218 
     219        The current counter state (the last result of a call to next) is also stored as attribute attribute. 
     220    """ 
     221    def __init__(self, places): 
     222        """ 
     223            :param places: Number of places. 
     224            :type places: int 
     225        """ 
     226        self.state=None 
     227        self.subcounter=None 
     228        self.places=places 
     229 
     230    def __iter__(self): 
     231        if self.state: 
     232            return self 
     233        else: 
     234            return NondecreasingCounter(self.places) 
     235 
     236    def next(self): 
     237        """Return the next state of the counter.""" 
     238        if not self.subcounter: 
     239            self.subcounter=BooleanCounter(self.places-1) 
     240        if self.subcounter.next(): 
     241            self.state=[0] 
     242            for add_one in self.subcounter.state: 
     243                self.state.append(self.state[-1]+add_one) 
     244        else: 
     245            self.state=None 
     246        if not self.state: 
     247            raise StopIteration, "NondecreasingCounter: counting finished" 
     248        return self.state 
     249 
     250 
     251class CanonicFuncCounter: 
     252    """ 
     253    Returns all sequences of a given length where no numbers are skipped (see below) and none of 
     254    the generated sequence is equal to another if only the labels are changed. For instance, [0, 2, 2, 1] 
     255    and [1, 0, 0, 2] are considered equivalent: if we take the former and replace 0 by 1, 2 
     256    by 0 and 1 by 2 we get the second list. 
     257 
     258    The sequences generated are equivalent to all possible functions from a set of cardinality of the sequences length. 
     259 
     260    >>> for t in Orange.misc.counters.CanonicFuncCounter(4): 
     261    ...     print t 
     262    ... 
     263    [0, 0, 0, 0] 
     264    [0, 0, 0, 1] 
     265    [0, 0, 1, 0] 
     266    [0, 0, 1, 1] 
     267    [0, 0, 1, 2] 
     268    [0, 1, 0, 0] 
     269    [0, 1, 0, 1] 
     270    [0, 1, 0, 2] 
     271    [0, 1, 1, 0] 
     272    [0, 1, 1, 1] 
     273    [0, 1, 1, 2] 
     274    [0, 1, 2, 0] 
     275    [0, 1, 2, 1] 
     276    [0, 1, 2, 2] 
     277    [0, 1, 2, 3] 
     278 
     279    .. attribute:: state 
     280 
     281        The current counter state (the last result of a call to next) is also stored as attribute attribute. 
     282    """ 
     283    def __init__(self, places): 
     284        """ 
     285            :param places: Number of places. 
     286            :type places: int 
     287        """ 
     288        self.places = places 
     289        self.state = None 
     290 
     291    def __iter__(self): 
     292        if self.state: 
     293            return self 
     294        else: 
     295            return CanonicFuncCounter(self.places) 
     296 
     297    def next(self): 
     298        """Return the next state of the counter.""" 
     299        if self.state: 
     300            i = self.places-1 
     301            while (i>0) and (self.state[i]==max(self.state[:i])+1): 
     302                self.state[i] = 0 
     303                i -= 1 
     304            if i: 
     305                self.state[i] += 1 
    93306            else: 
    94                 self.state = None 
    95                 raise StopIteration, "MofNCounter: counting finished" 
    96         else: 
    97             self.state = range(self.m) 
    98              
    99         return self.state[:] 
    100               
    101 class NondecreasingCounter: 
    102   def __init__(self, places): 
    103     self.state=None 
    104     self.subcounter=None 
    105     self.places=places 
    106  
    107   def __iter__(self): 
    108     if self.state: 
    109         return self 
    110     else: 
    111         return NondecreasingCounter(self.places) 
    112  
    113   def next(self): 
    114     if not self.subcounter: 
    115       self.subcounter=BooleanCounter(self.places-1) 
    116     if self.subcounter.next(): 
    117       self.state=[0] 
    118       for add_one in self.subcounter.state: 
    119         self.state.append(self.state[-1]+add_one) 
    120     else: 
    121       self.state=None 
    122    
    123     if not self.state: 
    124       raise StopIteration, "NondecreasingCounter: counting finished" 
    125  
    126     return self.state 
    127  
    128  
    129 class CanonicFuncCounter: 
    130   def __init__(self, places): 
    131     self.places = places 
    132     self.state = None 
    133  
    134   def __iter__(self): 
    135     if self.state: 
    136         return self 
    137     else: 
    138         return CanonicFuncCounter(self.places) 
    139  
    140   def next(self): 
    141     if self.state: 
    142       i = self.places-1 
    143       while (i>0) and (self.state[i]==max(self.state[:i])+1): 
    144         self.state[i] = 0 
    145         i -= 1 
    146       if i: 
    147         self.state[i] += 1 
    148       else: 
    149         self.state=None 
    150     else: 
    151       self.state = [0]*self.places 
    152  
    153     if not self.state: 
    154       raise StopIteration, "CanonicFuncCounter: counting finished" 
    155      
    156     return self.state 
     307                self.state=None 
     308        else: 
     309            self.state = [0]*self.places 
     310        if not self.state: 
     311            raise StopIteration, "CanonicFuncCounter: counting finished" 
     312        return self.state 
  • Orange/testing/regression/results_orange25/lasso-example.py.txt

    r9850 r9867  
    1 Actual: 24.00, predicted: 27.76  
    2 Actual: 21.60, predicted: 24.95  
    3 Actual: 34.70, predicted: 28.26  
    4 Actual: 33.40, predicted: 27.37  
    5 Actual: 36.20, predicted: 27.34  
     1Actual: 24.00, predicted: 26.54  
     2Actual: 21.60, predicted: 23.85  
     3Actual: 34.70, predicted: 26.35  
     4Actual: 33.40, predicted: 25.73  
     5Actual: 36.20, predicted: 25.55  
    66  Variable  Coeff Est  Std Error          p 
    77 Intercept     22.533 
    8       CRIM     -0.130      0.016      0.000   *** 
    9        NOX     -1.520      0.980      0.200       
    10         RM      2.993      0.803      0.000   *** 
    11    PTRATIO     -0.641      0.214      0.000   *** 
    12          B      0.007      0.002      0.000   *** 
    13      LSTAT     -0.205      0.101      0.000   *** 
     8        RM      1.962      0.859      0.000   *** 
     9       AGE     -0.007      0.003      0.160       
     10   PTRATIO     -0.627      0.193      0.000   *** 
     11         B      0.002      0.002      0.240       
     12     LSTAT     -0.174      0.103      0.000   *** 
    1413Signif. codes:  0 *** 0.001 ** 0.01 * 0.05 . 0.1 empty 1 
    1514 
    1615 
    17 For 7 variables the regression coefficient equals 0:  
     16For 8 variables the regression coefficient equals 0:  
     17CRIM 
    1818ZN 
    1919INDUS 
    2020CHAS 
    21 AGE 
     21NOX 
    2222DIS 
    2323RAD 
  • Orange/testing/regression/results_orange25/simple_tree_random_forest.py.txt

    r9854 r9868  
    44 
    55Runtimes: 
    6 for_gain 0.093346118927 
    7 for_simp 0.0253021717072 
     6for_gain 0.0942988395691 
     7for_simp 0.0253610610962 
  • Orange/testing/regression/results_orange25/svm-linear-weights.py.txt

    r9854 r9870  
    1 defaultdict(<type 'float'>, {FloatVariable 'alpha 0': 0.19198054903386352, FloatVariable 'Elu 300': 0.15913983311663107, FloatVariable 'spo- mid': 3.2086605964825132, FloatVariable 'Elu 330': 0.11474308886955724, FloatVariable 'alpha 14': 0.18310901108005986, FloatVariable 'alpha 98': 0.21754881357923167, FloatVariable 'Elu 360': 0.16577258493775038, FloatVariable 'alpha 21': 0.030539018557891578, FloatVariable 'diau d': 0.44932601596409105, FloatVariable 'Elu 390': 0.1820761083768519, FloatVariable 'spo- early': 1.9466556509082333, FloatVariable 'alpha 28': 0.04645238275160125, FloatVariable 'cdc15 10': 0.11428450056762224, FloatVariable 'alpha 35': 0.21379911334384863, FloatVariable 'cdc15 30': 0.18270335600911874, FloatVariable 'alpha 42': 0.13641650791763626, FloatVariable 'spo5 2': 0.40417556232809326, FloatVariable 'cdc15 50': 0.24968263583989325, FloatVariable 'alpha 70': 0.26459268873021585, FloatVariable 'alpha 49': 0.16085715739160683, FloatVariable 'cdc15 70': 0.13876265882583333, FloatVariable 'alpha 105': 0.14088060621674625, FloatVariable 'alpha 56': 0.3367416107117914, FloatVariable 'cdc15 90': 0.32729758144823035, FloatVariable 'alpha 63': 0.18433878873311124, FloatVariable 'cdc15 110': 0.564756618474929, FloatVariable 'Elu 60': 0.36698713537474476, FloatVariable 'dtt 60': 0.5951914850021424, FloatVariable 'cdc15 130': 0.3658301477295572, FloatVariable 'dtt 120': 0.55305024494988, FloatVariable 'heat 80': 0.38909905042009185, FloatVariable 'cdc15 150': 0.693249161777514, FloatVariable 'alpha 77': 0.20088381949723239, FloatVariable 'cdc15 170': 0.44789694844623534, FloatVariable 'alpha 91': 0.1905674816738207, FloatVariable 'cdc15 190': 0.16956982427965123, FloatVariable 'cold 40': 0.3092287272528724, FloatVariable 'alpha 112': 0.19329749923741518, FloatVariable 'cdc15 210': 0.15183429673463036, FloatVariable 'cold 160': 0.6947037871090163, FloatVariable 'Elu 90': 0.3834942300173535, FloatVariable 'cdc15 230': 0.5474715182870784, FloatVariable 'heat 0': 0.19091815990337407, FloatVariable 'heat 10': 1.000320207469925, FloatVariable 'diau a': 0.14935761521655416, FloatVariable 'cdc15 250': 0.3573777070361102, FloatVariable 'alpha 119': 0.1699365258012951, FloatVariable 'cdc15 270': 0.21951931922594184, FloatVariable 'Elu 0': 0.8466167037587657, FloatVariable 'alpha 7': 0.06557659077448137, FloatVariable 'alpha 84': 0.1308234316119738, FloatVariable 'heat 40': 0.4580618143377812, FloatVariable 'spo 0': 0.13024372486415015, FloatVariable 'diau b': 0.23473821977067888, FloatVariable 'diau e': 0.864767371223623, FloatVariable 'spo 2': 0.7078062232168753, FloatVariable 'Elu 180': 0.42425268429856355, FloatVariable 'diau f': 1.4452997087693935, FloatVariable 'spo 5': 1.0683498605674933, FloatVariable 'Elu 30': 0.4786304184632838, FloatVariable 'Elu 120': 0.5939764872379445, FloatVariable 'diau g': 2.248793727194904, FloatVariable 'heat 160': 0.3192185000510415, FloatVariable 'spo 7': 0.8081568079276176, FloatVariable 'Elu 270': 0.33471969574325466, FloatVariable 'Elu 150': 0.5965599387054419, FloatVariable 'dtt 15': 0.49451797411099035, FloatVariable 'spo 9': 0.2498282401589412, FloatVariable 'cold 20': 0.4097605043285248, FloatVariable 'spo 11': 0.20615575833508282, FloatVariable 'Elu 210': 0.12396520046361383, FloatVariable 'dtt 30': 0.5838556086306895, FloatVariable 'Elu 240': 0.2093390824178926, FloatVariable 'diau c': 0.13741762346585432, FloatVariable 'spo5 7': 0.26780459416067937, FloatVariable 'cdc15 290': 0.24965577080121784, FloatVariable 'cold 0': 0.27980454530046744, FloatVariable 'spo5 11': 1.200079459496442, FloatVariable 'heat 20': 0.9867456006798212}) 
     1defaultdict(<type 'float'>, {FloatVariable 'alpha 0': 0.19198054903386352, FloatVariable 'Elu 300': 0.15913983311663107, FloatVariable 'spo- mid': 3.2086605964825132, FloatVariable 'Elu 330': 0.11474308886955724, FloatVariable 'alpha 14': 0.18310901108005986, FloatVariable 'alpha 98': 0.21754881357923167, FloatVariable 'Elu 360': 0.16577258493775038, FloatVariable 'Elu 180': 0.42425268429856355, FloatVariable 'alpha 21': 0.030539018557891578, FloatVariable 'Elu 30': 0.4786304184632838, FloatVariable 'Elu 390': 0.1820761083768519, FloatVariable 'spo- early': 1.9466556509082333, FloatVariable 'alpha 28': 0.04645238275160125, FloatVariable 'cdc15 10': 0.11428450056762224, FloatVariable 'alpha 35': 0.21379911334384863, FloatVariable 'cdc15 30': 0.18270335600911874, FloatVariable 'alpha 42': 0.13641650791763626, FloatVariable 'cdc15 50': 0.24968263583989325, FloatVariable 'alpha 70': 0.26459268873021585, FloatVariable 'alpha 49': 0.16085715739160683, FloatVariable 'cdc15 70': 0.13876265882583333, FloatVariable 'alpha 105': 0.14088060621674625, FloatVariable 'diau b': 0.23473821977067888, FloatVariable 'alpha 56': 0.3367416107117914, FloatVariable 'cdc15 90': 0.32729758144823035, FloatVariable 'alpha 63': 0.18433878873311124, FloatVariable 'cdc15 110': 0.564756618474929, FloatVariable 'Elu 60': 0.36698713537474476, FloatVariable 'dtt 60': 0.5951914850021424, FloatVariable 'cdc15 130': 0.3658301477295572, FloatVariable 'alpha 77': 0.20088381949723239, FloatVariable 'heat 80': 0.38909905042009185, FloatVariable 'cdc15 150': 0.693249161777514, FloatVariable 'alpha 84': 0.1308234316119738, FloatVariable 'cdc15 170': 0.44789694844623534, FloatVariable 'cold 20': 0.4097605043285248, FloatVariable 'cdc15 190': 0.16956982427965123, FloatVariable 'cold 40': 0.3092287272528724, FloatVariable 'alpha 112': 0.19329749923741518, FloatVariable 'cdc15 210': 0.15183429673463036, FloatVariable 'cold 160': 0.6947037871090163, FloatVariable 'diau f': 1.4452997087693935, FloatVariable 'cdc15 230': 0.5474715182870784, FloatVariable 'heat 0': 0.19091815990337407, FloatVariable 'diau a': 0.14935761521655416, FloatVariable 'heat 160': 0.3192185000510415, FloatVariable 'cdc15 250': 0.3573777070361102, FloatVariable 'heat 40': 0.4580618143377812, FloatVariable 'cdc15 270': 0.21951931922594184, FloatVariable 'spo5 2': 0.40417556232809326, FloatVariable 'Elu 0': 0.8466167037587657, FloatVariable 'alpha 7': 0.06557659077448137, FloatVariable 'cold 0': 0.27980454530046744, FloatVariable 'diau d': 0.44932601596409105, FloatVariable 'spo 0': 0.13024372486415015, FloatVariable 'alpha 119': 0.1699365258012951, FloatVariable 'diau e': 0.864767371223623, FloatVariable 'spo 2': 0.7078062232168753, FloatVariable 'heat 10': 1.000320207469925, FloatVariable 'spo 5': 1.0683498605674933, FloatVariable 'Elu 120': 0.5939764872379445, FloatVariable 'diau g': 2.248793727194904, FloatVariable 'spo 7': 0.8081568079276176, FloatVariable 'Elu 150': 0.5965599387054419, FloatVariable 'Elu 90': 0.3834942300173535, FloatVariable 'spo 9': 0.2498282401589412, FloatVariable 'dtt 30': 0.5838556086306895, FloatVariable 'alpha 91': 0.1905674816738207, FloatVariable 'spo 11': 0.20615575833508282, FloatVariable 'Elu 210': 0.12396520046361383, FloatVariable 'cdc15 290': 0.24965577080121784, FloatVariable 'dtt 15': 0.49451797411099035, FloatVariable 'Elu 240': 0.2093390824178926, FloatVariable 'diau c': 0.13741762346585432, FloatVariable 'spo5 7': 0.26780459416067937, FloatVariable 'dtt 120': 0.55305024494988, FloatVariable 'Elu 270': 0.33471969574325466, FloatVariable 'spo5 11': 1.200079459496442, FloatVariable 'heat 20': 0.9867456006798212}) 
  • docs/reference/rst/code/mds-euclid-torgerson-3d.py

    r9823 r9866  
    1111 
    1212# Construct a distance matrix using Euclidean distance 
    13 dist = Orange.distance.instances.EuclideanConstructor(iris) 
     13dist = Orange.distance.Euclidean(iris) 
    1414matrix = Orange.core.SymMatrix(len(iris)) 
    1515matrix.setattr('items', iris) 
    1616for i in range(len(iris)): 
    17     for j in range(i+1): 
     17    for j in range(i + 1): 
    1818        matrix[i, j] = dist(iris[i], iris[j]) 
    1919 
  • docs/reference/rst/code/unusedValues.py

    r9754 r9869  
    22data = Orange.data.Table("unusedValues") 
    33 
    4 new_variables = [Orange.core.RemoveUnusedValues(var, data) for variable in data.domain.variables] 
     4new_variables = [Orange.core.RemoveUnusedValues(var, data) for var in data.domain.variables] 
    55 
    66print 
Note: See TracChangeset for help on using the changeset viewer.