Ignore:
Files:
7 added
1 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • Orange/__init__.py

    r9944 r9986  
    1919_import("data.io") 
    2020_import("data.sample") 
     21_import("data.utils") 
    2122_import("data.discretization") 
    2223 
  • Orange/clustering/kmeans.py

    r9725 r9977  
    176176score_distance_to_centroids.minimize = True 
    177177 
    178 def score_conditionalEntropy(km): 
     178def score_conditional_entropy(km): 
    179179    """UNIMPLEMENTED cluster quality measured by conditional entropy""" 
    180     pass 
    181  
    182 def score_withinClusterDistance(km): 
     180    raise NotImplemented 
     181 
     182def score_within_cluster_distance(km): 
    183183    """UNIMPLEMENTED weighted average within-cluster pairwise distance""" 
    184     pass 
    185  
    186 score_withinClusterDistance.minimize = True 
    187  
    188 def score_betweenClusterDistance(km): 
     184    raise NotImplemented 
     185 
     186score_within_cluster_distance.minimize = True 
     187 
     188def score_between_cluster_distance(km): 
    189189    """Sum of distances from elements to 'nearest miss' centroids""" 
    190190    return sum(min(km.distance(c, d) for j,c in enumerate(km.centroids) if j!=km.clusters[i]) for i,d in enumerate(km.data)) 
     191 
     192from Orange.misc import deprecated_function_name 
     193score_betweenClusterDistance = deprecated_function_name(score_between_cluster_distance) 
    191194 
    192195def score_silhouette(km, index=None): 
  • Orange/clustering/mixture.py

    r9919 r9976  
    277277    """ Computes the gaussian mixture model from an Orange data-set. 
    278278    """ 
    279     def __new__(cls, data=None, weightId=None, **kwargs): 
     279    def __new__(cls, data=None, weight_id=None, **kwargs): 
    280280        self = object.__new__(cls) 
    281281        if data is not None: 
    282282            self.__init__(**kwargs) 
    283             return self.__call__(data, weightId) 
     283            return self.__call__(data, weight_id) 
    284284        else: 
    285285            return self 
     
    289289        self.init_function = init_function 
    290290         
    291     def __call__(self, data, weightId=None): 
     291    def __call__(self, data, weight_id=None): 
    292292        from Orange.preprocess import Preprocessor_impute, DomainContinuizer 
    293293#        data = Preprocessor_impute(data) 
  • Orange/data/utils.py

    r9936 r9986  
    1 """\ 
    2 ************************** 
    3 Data Utilities (``utils``) 
    4 ************************** 
    5  
    6 Common operations on :class:`Orange.data.Table`. 
    7  
    8 """ 
    91#from __future__ import absolute_import 
     2 
     3from Orange.core import TransformValue, \ 
     4    Ordinal2Continuous, \ 
     5    Discrete2Continuous, \ 
     6    NormalizeContinuous, \ 
     7    MapIntValue 
     8 
    109 
    1110import random 
  • Orange/fixes/fix_changed_names.py

    r9942 r9986  
    586586           "orange.RandomGenerator": "Orange.misc.Random", 
    587587 
     588           "orange.TransformValue": "Orange.data.utils.TransformValue", 
     589           "orange.Ordinal2Continuous": "Orange.data.utils.Ordinal2Continuous", 
     590           "orange.Discrete2Continuous": "Orange.data.utils.Discrete2Continuous", 
     591           "orange.NormalizeContinuous": "Orange.data.utils.NormalizeContinuous", 
     592           "orange.MapIntValue": "Orange.data.utils.MapIntValue", 
     593 
    588594           } 
    589595 
  • Orange/testing/regression/tests_20/exclude-from-regression.txt

    r9952 r9982  
    1919reference_graph_analyses.py 
    2020reference_pathfinder.py 
     21modules_server_files1.py 
     22modules_server_files2.py 
  • Orange/testing/unit/tests/test_association.py

    r9679 r9979  
    1414         
    1515    self.assertLessEqual(len(rules), self.inducer.max_item_sets) 
    16     print "\n%5s   %5s" % ("supp", "conf") 
    1716    for r in rules: 
    18         print "%5.3f   %5.3f   %s" % (r.support, r.confidence, r) 
    1917        self.assertGreaterEqual(r.support, self.inducer.support) 
    2018        self.assertIsNotNone(r.left) 
  • Orange/testing/unit/tests/test_ensemble.py

    r9679 r9978  
    2323        testing.LearnerTestCase.test_pickling_on(self, dataset) 
    2424 
     25 
    2526@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS) 
    2627class TestRandomForest(testing.LearnerTestCase): 
     
    3132    @test_on_datasets(datasets=["iris"]) 
    3233    def test_pickling_on(self, dataset): 
    33         testing.LearnerTestCase.test_pickling_on(self, dataset) 
     34        raise NotImplemented("SmallTreeLearner pickling is not implemented") 
     35#        testing.LearnerTestCase.test_pickling_on(self, dataset) 
     36         
    3437         
    3538         
  • docs/reference/rst/Orange.data.rst

    r9941 r9986  
    1313    Orange.data.discretization 
    1414    Orange.data.continuization 
     15    Orange.data.utils 
  • docs/reference/rst/code/datatable1.py

    r9945 r9984  
    1010values = ["1", "2", "3", "4"] 
    1111 
    12 features = [Orange.feature.Discrete(name, values = values[:card]) 
     12features = [Orange.feature.Discrete(name, values=values[:card]) 
    1313              for name, card in zip("abcdef", cards)] 
    14 classattr = Orange.feature.Discrete("y", values = ["0", "1"]) 
     14classattr = Orange.feature.Discrete("y", values=["0", "1"]) 
    1515domain = Orange.data.Domain(features + [classattr]) 
    1616data = Orange.data.Table(domain) 
     
    2020 
    2121for i in range(5): 
    22     inst = [random.randint(0, c-1) for c in card] 
    23     inst.append(inst[0]==inst[1] or inst[4]==0) 
     22    inst = [random.randint(0, c - 1) for c in cards] 
     23    inst.append(inst[0] == inst[1] or inst[4] == 0) 
    2424    data.append(inst) 
    2525 
     
    2727    print inst 
    2828 
    29 loe = [["3", "1", "1", "2", "1", "1",  "1"], 
    30        ["3", "1", "1", "2", "2", "1",  "0"], 
    31        ["3", "3", "1", "2", "2", "1",  "1"] 
     29loe = [["3", "1", "1", "2", "1", "1", "1"], 
     30       ["3", "1", "1", "2", "2", "1", "0"], 
     31       ["3", "3", "1", "2", "2", "1", "1"] 
    3232      ] 
    3333 
     
    3737 
    3838import numpy 
    39 d = Orange.data.Domain([Orange.feature.Continuous('a%i'%x) for x in range(5)]) 
     39d = Orange.data.Domain([Orange.feature.Continuous('a%i' % x) for x in range(5)]) 
    4040a = numpy.array([[1, 2, 3, 4, 5], [5, 4, 3, 2, 1]]) 
    4141t = Orange.data.Table(a) 
  • docs/reference/rst/code/transformvalue-d2c.py

    r9970 r9987  
    55 
    66e1 = Orange.feature.Continuous("e=1") 
    7 e1.getValueFrom = Orange.core.ClassifierFromVar(whichVar=data.domain["e"]) 
    8 e1.getValueFrom.transformer = Orange.core.Discrete2Continuous() 
     7e1.getValueFrom = Orange.core.ClassifierFromVar(whichVar = data.domain["e"]) 
     8e1.getValueFrom.transformer = Orange.data.utils.Discrete2Continuous() 
     9e1.getValueFrom.transformer.value = int(Orange.data.Value(e, "1")) 
  • docs/reference/rst/code/transformvalue-miv.py

    r9924 r9986  
    66age_b = Orange.feature.Discrete("age_c", values = ['young', 'old']) 
    77age_b.getValueFrom = Orange.core.ClassifierFromVar(whichVar = age) 
    8 age_b.getValueFrom.transformer = Orange.core.MapIntValue() 
     8age_b.getValueFrom.transformer = Orange.data.utils.MapIntValue() 
    99age_b.getValueFrom.transformer.mapping = [0, 1, 1] 
    1010 
  • docs/reference/rst/code/transformvalue-nc.py

    r9924 r9986  
    88    attr_c = Orange.feature.Continous(attr.name+"_n") 
    99    attr_c.getValueFrom = Orange.core.ClassifierFromVar(whichVar = attr) 
    10     transformer = Orange.core.NormalizeContinuous() 
     10    transformer = Orange.data.utils.NormalizeContinuous() 
    1111    attr_c.getValueFrom.transformer = transformer 
    1212    transformer.average = domstat[attr].avg 
  • docs/reference/rst/code/transformvalue-o2c.py

    r9924 r9986  
    1313age_c = Orange.feature.Continuous("age_c") 
    1414age_c.getValueFrom = Orange.core.ClassifierFromVar(whichVar = age) 
    15 age_c.getValueFrom.transformer = Orange.core.Ordinal2Continuous() 
     15age_c.getValueFrom.transformer = Orange.data.utils.Ordinal2Continuous() 
    1616 
    1717age_cn = Orange.feature.Continuous("age_cn") 
    1818age_cn.getValueFrom = Orange.core.ClassifierFromVar(whichVar = age) 
    19 age_cn.getValueFrom.transformer = Orange.core.Ordinal2Continuous() 
     19age_cn.getValueFrom.transformer = Orange.data.utils.Ordinal2Continuous() 
    2020age_cn.getValueFrom.transformer.factor = 0.5 
    2121 
Note: See TracChangeset for help on using the changeset viewer.