Ignore:
Files:
1 deleted
46 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

    r9917 r9932  
    5252docs/tutorial/rst/code/tree.dot 
    5353 
     54source/orangeqt/Makefile 
  • Orange/__init__.py

    r9698 r9929  
    1919_import("data.io") 
    2020_import("data.sample") 
    21 _import("data.variable") 
    2221 
    2322_import("network") 
  • Orange/classification/logreg.py

    r9923 r9936  
    254254        # get extended Model (you should not change data) 
    255255        if weight == 0: 
    256             weight = Orange.data.new_meta_id() 
     256            weight = Orange.feature.Descriptor.new_meta_id() 
    257257            instances.addMetaAttribute(weight, 1.0) 
    258258        extended_set_of_examples = createLogRegExampleTable(instances, weight) 
     
    377377        # get extended Model (you should not change data) 
    378378        if weight == 0: 
    379             weight = Orange.data.new_meta_id() 
     379            weight = Orange.feature.Descriptor.new_meta_id() 
    380380            instances.addMetaAttribute(weight, 1.0) 
    381381        extended_examples = createLogRegExampleTable(instances, weight) 
  • Orange/classification/rules.py

    r9919 r9936  
    13351335        (newDomain, targetVal) = create_dichotomous_class(examples.domain, examples.domain.class_var, str(cl), negate=0) 
    13361336        newDomainmetas = newDomain.getmetas() 
    1337         newDomain.addmeta(Orange.data.new_meta_id(), examples.domain.class_var) # old class as meta 
     1337        newDomain.addmeta(Orange.feature.Descriptor.new_meta_id(), examples.domain.class_var) # old class as meta 
    13381338        dichData = examples.select(newDomain) 
    13391339        if self.argument_id: 
     
    17311731    def __call__(self, rule, instances, weights, target_class): 
    17321732        if not weights: 
    1733             weights = Orange.data.new_meta_id() 
     1733            weights = Orange.feature.Descriptor.new_meta_id() 
    17341734            instances.addMetaAttribute(weights, 1.) 
    17351735            instances.domain.addmeta(weights, Orange.feature.\ 
    17361736                Continuous("weights-" + str(weights)), True) 
    1737         newWeightsID = Orange.data.new_meta_id() 
     1737        newWeightsID = Orange.feature.Descriptor.new_meta_id() 
    17381738        instances.addMetaAttribute(newWeightsID, 1.) 
    17391739        instances.domain.addmeta(newWeightsID, Orange.feature.\ 
     
    17561756    def __call__(self, rule, instances, weights, target_class): 
    17571757        if not weights: 
    1758             weights = Orange.data.new_meta_id() 
     1758            weights = Orange.feature.Descriptor.new_meta_id() 
    17591759            instances.addMetaAttribute(weights, 1.) 
    17601760            instances.domain.addmeta(weights, Orange.feature.\ 
     
    17641764        except: 
    17651765            coverage = Orange.feature.Continuous("Coverage") 
    1766             instances.domain.addmeta(Orange.data.new_meta_id(), coverage, True) 
     1766            instances.domain.addmeta(Orange.feature.Descriptor.new_meta_id(), coverage, True) 
    17671767            instances.addMetaAttribute(coverage, 0.0) 
    1768         newWeightsID = Orange.data.new_meta_id() 
     1768        newWeightsID = Orange.feature.Descriptor.new_meta_id() 
    17691769        instances.addMetaAttribute(newWeightsID, 1.) 
    17701770        instances.domain.addmeta(newWeightsID, Orange.feature.\ 
     
    17871787    def __init__(self, examples, weight_id, target_class, apriori, argument_id): 
    17881788        self.best_rule = [None] * len(examples) 
    1789         self.prob_attribute = Orange.data.new_meta_id() 
     1789        self.prob_attribute = Orange.feature.Descriptor.new_meta_id() 
    17901790        self.apriori_prob = apriori[target_class] / apriori.abs 
    17911791        examples.addMetaAttribute(self.prob_attribute, self.apriori_prob) 
  • Orange/classification/svm/__init__.py

    r9923 r9933  
    7979.. autoclass:: Orange.classification.svm.RFE 
    8080 
    81 .. autoclass:: Orange.classification.svm.Score_SVMWeights 
     81.. autoclass:: Orange.classification.svm.ScoreSVMWeights 
    8282    :show-inheritance: 
    8383  
     
    253253                 coef0=0, shrinking=True, probability=True, verbose=False,  
    254254                 cache_size=200, eps=0.001, normalization=True, 
    255                  weight=[], **kwargs): 
     255                 weight=(), **kwargs): 
    256256        self.svm_type = svm_type 
    257257        self.kernel_type = kernel_type 
     
    684684exampleWeightedSum = example_weighted_sum 
    685685 
    686 class Score_SVMWeights(Orange.feature.scoring.Score): 
     686class ScoreSVMWeights(Orange.feature.scoring.Score): 
    687687    """Score feature by training a linear SVM classifier, using a squared sum of  
    688688    weights (of each binary classifier) as the returned score. 
     
    690690    Example: 
    691691     
    692         >>> score = Score_SVMWeights() 
     692        >>> score = ScoreSVMWeights() 
    693693        >>> for feature in table.domain.features: 
    694694            ...   print "%15s: %.3f" % (feature.name, score(feature, table)) 
     
    696696    """ 
    697697     
    698     def __new__(cls, attr=None, data=None, weightId=None, **kwargs): 
     698    def __new__(cls, attr=None, data=None, weight_id=None, **kwargs): 
    699699        self = Orange.feature.scoring.Score.__new__(cls, **kwargs) 
    700700        if data is not None and attr is not None: 
    701701            self.__init__(**kwargs) 
    702             return self.__call__(attr, data, weightId) 
     702            return self.__call__(attr, data, weight_id) 
    703703        else: 
    704704            return self 
    705705         
    706706    def __reduce__(self): 
    707         return Score_SVMWeights, (), dict(self.__dict__) 
     707        return ScoreSVMWeights, (), dict(self.__dict__) 
    708708     
    709709    def __init__(self, learner=None, **kwargs): 
     
    722722        self._cached_examples = None 
    723723         
    724     def __call__(self, attr, data, weightId=None): 
     724    def __call__(self, attr, data, weight_id=None): 
    725725        if data is self._cached_examples: 
    726726            weights = self._cached_weights 
    727727        else: 
    728             classifier = self.learner(data, weightId) 
     728            classifier = self.learner(data, weight_id) 
    729729            self._cached_examples = data 
    730730            import numpy 
     
    735735        return weights.get(attr, 0.0) 
    736736 
    737 MeasureAttribute_SVMWeights = Score_SVMWeights 
     737MeasureAttribute_SVMWeights = ScoreSVMWeights 
    738738 
    739739class RFE(object): 
  • Orange/data/__init__.py

    r9891 r9929  
    66from orange import Example as Instance 
    77from orange import Value, StringValue, Domain 
    8  
    9 from orange import VarTypes as Type 
    10  
    11 from orange import newmetaid as new_meta_id 
  • Orange/data/io.py

    r9923 r9936  
    693693                class_indices.append(i) 
    694694            elif flag == "meta": 
    695                 mid = Orange.data.new_meta_id() 
     695                mid = Orange.feature.Descriptor.new_meta_id() 
    696696                metas[mid] = var 
    697697                meta_attribute_load_status[mid] = status 
  • Orange/data/utils.py

    r9671 r9936  
    1515from collections import defaultdict 
    1616 
    17 from Orange.data import Table, Domain, Instance, variable  
     17from Orange.data import Table, Domain, Instance 
     18 
     19import feature as variable 
    1820 
    1921def table_map(table, attrs, exclude_special=True): 
     
    160162        yield str(uuid.uuid4()) 
    161163 
    162 from Orange.data import new_meta_id, variable 
     164import Orange.feature 
     165new_meta_id = Orange.feature.Descriptor.new_meta_id 
    163166 
    164167_row_meta_id = new_meta_id() 
  • Orange/ensemble/boosting.py

    r9919 r9936  
    5252        """ 
    5353        import math 
    54         weight = Orange.data.new_meta_id() 
     54        weight = Orange.feature.Descriptor.new_meta_id() 
    5555        if orig_weight: 
    5656            for i in instances: 
  • Orange/evaluation/reliability.py

    r9919 r9936  
    402402        nearest_neighbours_constructor.distanceConstructor = Orange.distance.Euclidean() 
    403403         
    404         distance_id = Orange.data.new_meta_id() 
     404        distance_id = Orange.feature.Descriptor.new_meta_id() 
    405405        nearest_neighbours = nearest_neighbours_constructor(instances, 0, distance_id) 
    406406         
     
    469469        nearest_neighbours_constructor.distanceConstructor = Orange.distance.Euclidean() 
    470470         
    471         distance_id = Orange.data.new_meta_id() 
     471        distance_id = Orange.feature.Descriptor.new_meta_id() 
    472472        nearest_neighbours = nearest_neighbours_constructor(instances, 0, distance_id) 
    473473        return CNeighboursClassifier(nearest_neighbours, self.k) 
     
    516516        nnm.distanceConstructor = Orange.distance.Mahalanobis() 
    517517         
    518         mid = Orange.data.new_meta_id() 
     518        mid = Orange.feature.Descriptor.new_meta_id() 
    519519        nnm = nnm(instances, 0, mid) 
    520520        return MahalanobisClassifier(self.k, nnm, mid) 
  • Orange/feature/__init__.py

    r9919 r9936  
    1616from Orange.core import StringVariable as String 
    1717 
    18 from Orange.core import newmetaid as new_meta_id 
    1918from Orange.core import VarTypes as Type 
    2019 
  • Orange/feature/discretization.py

    r9900 r9927  
    135135 
    136136    :param features: data features to discretize. None (default) to discretize all features. 
    137     :type features: list of :class:`Orange.data.variable.Variable` 
     137    :type features: list of :class:`Orange.feature.Descriptor` 
    138138 
    139139    :param method: feature discretization method. 
  • Orange/fixes/fix_changed_names.py

    r9923 r9936  
    4141           "orange.PythonVariable": "Orange.feature.Python", 
    4242 
    43            "orange.newmetaid": "Orange.feature.new_meta_id", 
     43           "orange.newmetaid": "Orange.feature:Variable.new_meta_id" 
    4444 
    4545           "orange.SymMatrix": "Orange.misc.SymMatrix", 
  • Orange/multilabel/mulan.py

    r9919 r9927  
    33from xml.dom.minidom import Node 
    44 
    5 def trans_mulan_data(xml_name,arff_name, create_on_new = Orange.feature.MakeStatus.Incompatible, **kwargs): 
     5def trans_mulan_data(xml_name,arff_name, create_on_new = Orange.feature.Descriptor.MakeStatus.Incompatible, **kwargs): 
    66    """ Transform the mulan data format to Tab file. 
    77     
  • Orange/multilabel/multiknn.py

    r9724 r9936  
    7070        nnc.distanceConstructor = Orange.distance.Euclidean() 
    7171         
    72         weight_id = Orange.data.new_meta_id() 
     72        weight_id = Orange.feature.Descriptor.new_meta_id() 
    7373        self.knn = nnc(instances, 0, weight_id) 
    7474        self.weight_id = weight_id 
  • Orange/projection/pca.py

    r9671 r9927  
    11import Orange.data 
    2 import Orange.data.variable 
     2import Orange.feature 
    33import numpy as np 
    44     
     
    9090         
    9191        n, m = U.shape 
    92         pc_domain = Orange.data.Domain([Orange.data.variable.Continuous("Comp.%d"%(i+1)) for i in range(n)], False) 
     92        pc_domain = Orange.data.Domain([Orange.feature.Continuous("Comp.%d"%(i+1)) for i in range(n)], False) 
    9393         
    9494        return PcaClassifier(input_domain = dataset.domain, 
  • Orange/regression/earth.py

    r9671 r9927  
    5555 
    5656import Orange 
    57 from Orange.data.variable import Discrete, Continuous 
     57from Orange.feature import Discrete, Continuous 
    5858from Orange.data import Table, Domain 
    5959from Orange.preprocess import Preprocessor_continuize, \ 
     
    12221222#    def __call__(self, example, what=Orange.core.GetValue): 
    12231223#        value = self.predict(example) 
    1224 #        if isinstance(self.class_var, Orange.data.variable.Continuous): 
     1224#        if isinstance(self.class_var, Orange.feature.Continuous): 
    12251225#            value = self.class_var(value) 
    12261226#        else: 
  • Orange/regression/lasso.py

    r9776 r9927  
    214214            all data instances are eqaully important in fitting 
    215215            the regression parameters 
    216         :type weight: None or list of Orange.data.variable.Continuous 
     216        :type weight: None or list of Orange.feature.Continuous 
    217217            which stores weights for instances 
    218218         
  • Orange/regression/linear.py

    r9776 r9927  
    171171        :param use_vars: the list of independent varaiables included in 
    172172            regression model. If None (default) all variables are used 
    173         :type use_vars: list of Orange.data.variable or None 
     173        :type use_vars: list of Orange.feature.Descriptor or None 
    174174        :param stepwise: if True, `stepwise regression 
    175175            <http://en.wikipedia.org/wiki/Stepwise_regression>`_ 
     
    205205            all data instances are eqaully important in fitting 
    206206            the regression parameters 
    207         :type weight: None or list of Orange.data.variable.Continuous 
     207        :type weight: None or list of Orange.feature.Continuous 
    208208            which stores weights for instances 
    209209        """        
     
    552552    :param weight: the weights for instances. Default: None, i.e. all data 
    553553        instances are eqaully important in fitting the regression parameters 
    554     :type weight: None or list of Orange.data.variable.Continuous 
     554    :type weight: None or list of Orange.feature.Continuous 
    555555        which stores the weights 
    556556    :param add_sig: lower bound of significance for which the variable 
  • Orange/regression/pls.py

    r9776 r9927  
    235235 
    236236        :param x_vars, y_vars: List of input and response variables 
    237             (:obj:`Orange.data.variable.Continuous` or 
    238             :obj:`Orange.data.variable.Discrete`). If None (default) it is 
     237            (:obj:`Orange.feature.Continuous` or 
     238            :obj:`Orange.feature.Discrete`). If None (default) it is 
    239239            assumed that the data domain provides information which variables 
    240240            are reponses and which are not. If data has 
  • Orange/statistics/contingency.py

    r9923 r9927  
    5757    .. attribute:: outerVariable 
    5858 
    59        Outer variable (:class:`Orange.data.variable.Variable`) whose values are 
     59       Outer variable (:class:`Orange.feature.Descriptor`) whose values are 
    6060       used as the first, outer index. 
    6161 
    6262    .. attribute:: innerVariable 
    6363 
    64        Inner variable(:class:`Orange.data.variable.Variable`), whose values are 
     64       Inner variable(:class:`Orange.feature.Descriptor`), whose values are 
    6565       used as the second, inner index. 
    6666  
     
    8383 
    8484        The type of the outer variable (:obj:`Orange.feature.Type`, usually 
    85         :obj:`Orange.data.variable.Discrete` or 
    86         :obj:`Orange.data.variable.Continuous`); equals 
     85        :obj:`Orange.feature.Discrete` or 
     86        :obj:`Orange.feature.Continuous`); equals 
    8787        ``outerVariable.varType`` and ``outerDistribution.varType``. 
    8888 
     
    9393      
    9494        :param outer_variable: Descriptor of the outer variable 
    95         :type outer_variable: Orange.data.variable.Variable 
     95        :type outer_variable: Orange.feature.Descriptor 
    9696        :param outer_variable: Descriptor of the inner variable 
    97         :type inner_variable: Orange.data.variable.Variable 
     97        :type inner_variable: Orange.feature.Descriptor 
    9898         
    9999    .. method:: add(outer_value, inner_value[, weight=1]) 
     
    210210 
    211211        :param feature: Outer variable 
    212         :type feature: Orange.data.variable.Variable 
     212        :type feature: Orange.feature.Descriptor 
    213213        :param class_attribute: Class variable; used as ``innerVariable`` 
    214         :type class_attribute: Orange.data.variable.Variable 
     214        :type class_attribute: Orange.feature.Descriptor 
    215215         
    216216    .. method:: __init__(feature, data[, weightId]) 
     
    219219 
    220220        :param feature: Outer variable 
    221         :type feature: Orange.data.variable.Variable 
     221        :type feature: Orange.feature.Descriptor 
    222222        :param data: A set of instances 
    223223        :type data: Orange.data.Table 
     
    299299 
    300300        :param feature: Outer variable 
    301         :type feature: Orange.data.variable.Variable 
     301        :type feature: Orange.feature.Descriptor 
    302302        :param class_variable: Class variable 
    303         :type class_variable: Orange.data.variable.Variable 
     303        :type class_variable: Orange.feature.Descriptor 
    304304         
    305305    .. method:: __init__(feature, data[, weightId]) 
     
    308308 
    309309        :param feature: Descriptor of the outer variable 
    310         :type feature: Orange.data.variable.Variable 
     310        :type feature: Orange.feature.Descriptor 
    311311        :param data: A set of instances 
    312312        :type data: Orange.data.Table 
     
    374374 
    375375        :param outer_variable: Outer variable 
    376         :type outer_variable: Orange.data.variable.Variable 
     376        :type outer_variable: Orange.feature.Descriptor 
    377377        :param inner_variable: Inner variable 
    378         :type inner_variable: Orange.data.variable.Variable 
     378        :type inner_variable: Orange.feature.Descriptor 
    379379        :param data: A set of instances 
    380380        :type data: Orange.data.Table 
  • Orange/statistics/distribution.py

    r9923 r9927  
    9292        Construct either :obj:`DiscDistribution` or :obj:`ContDistribution`, 
    9393        depending on the variable type. If the variable is the only argument, it 
    94         must be an instance of :obj:`Orange.data.variable.Variable`. In that case, 
     94        must be an instance of :obj:`Orange.feature.Descriptor`. In that case, 
    9595        an empty distribution is constructed. If data is given as well, the 
    9696        variable can also be specified by name or index in the 
     
    165165 
    166166        :param variable: A discrete variable 
    167         :type variable: Orange.data.variable.Discrete 
     167        :type variable: Orange.feature.Discrete 
    168168 
    169169    .. method:: __init__(frequencies) 
     
    207207 
    208208        :param variable: A continuous variable 
    209         :type variable: Orange.data.variable.Continuous 
     209        :type variable: Orange.feature.Continuous 
    210210 
    211211    .. method:: __init__(frequencies) 
  • Orange/testing/unit/tests/test_evaluation.py

    r9679 r9936  
    44import Orange 
    55 
    6 example_no = Orange.data.variable.new_meta_id() 
     6example_no = Orange.feature.Descriptor.new_meta_id() 
    77 
    88class DummyLearner(Orange.classification.majority.MajorityLearner): 
     
    6666            inst[self.example_no] = i 
    6767 
    68         self.preprocessed_with_both = Orange.data.variable.new_meta_id() 
    69         self.preprocessed_with_learn = Orange.data.variable.new_meta_id() 
    70         self.preprocessed_with_test = Orange.data.variable.new_meta_id() 
    71         self.preprocessed_with_learn_test = Orange.data.variable.new_meta_id() 
     68        self.preprocessed_with_both = Orange.feature.Descriptor.new_meta_id() 
     69        self.preprocessed_with_learn = Orange.feature.Descriptor.new_meta_id() 
     70        self.preprocessed_with_test = Orange.feature.Descriptor.new_meta_id() 
     71        self.preprocessed_with_learn_test = Orange.feature.Descriptor.new_meta_id() 
    7272        self.preprocessors = (("B", DummyPreprocessor(self.preprocessed_with_both)), 
    7373                              ("L", DummyPreprocessor(self.preprocessed_with_learn)), 
  • Orange/testing/unit/tests/test_variable.py

    r9923 r9927  
    77        """ Test Variable.make 
    88        """ 
    9         v1, s = Orange.data.variable.make("test_variable_a", 
     9        v1, s = Orange.feature.Descriptor.make("test_variable_a", 
    1010                                      Orange.feature.Type.Discrete,["a", "b"]) 
    11         v2, s = Orange.data.variable.make("test_variable_a", 
     11        v2, s = Orange.feature.Descriptor.make("test_variable_a", 
    1212                                      Orange.feature.Type.Discrete, ["a"], ["c"]) 
    1313        self.assertIs(v2, v1) 
    1414         
    15         v3, s = Orange.data.variable.make("test_variable_a", 
     15        v3, s = Orange.feature.Descriptor.make("test_variable_a", 
    1616                          Orange.feature.Type.Discrete, ["a", "b", "c", "d"]) 
    1717        self.assertIs(v3, v1) 
    1818         
    19         v4, s = Orange.data.variable.make("test_variable_a", 
     19        v4, s = Orange.feature.Descriptor.make("test_variable_a", 
    2020                                     Orange.feature.Type.Discrete, ["b"]) 
    2121        self.assertIsNot(v4, v1) 
    2222         
    23         v5, s = Orange.data.variable.make("test_variable_a", 
     23        v5, s = Orange.feature.Descriptor.make("test_variable_a", 
    2424                             Orange.feature.Type.Discrete, None, ["c", "a"]) 
    2525        self.assertIs(v5, v1) 
    2626         
    27         v6, s = Orange.data.variable.make("test_variable_a",  
     27        v6, s = Orange.feature.Descriptor.make("test_variable_a",  
    2828                            Orange.feature.Type.Discrete, None, ["e"]) 
    2929        self.assertIs(v6, v1) 
    3030         
    31         v7, s = Orange.data.variable.make("test_variable_a", 
     31        v7, s = Orange.feature.Descriptor.make("test_variable_a", 
    3232                                 Orange.feature.Type.Discrete, None, ["f"], 
    3333                                 Orange.feature.Descriptor.MakeStatus.NoRecognizedValues) 
    3434        self.assertIsNot(v7, v1) 
    3535         
    36         v8, s = Orange.data.variable.make("test_variable_a", 
     36        v8, s = Orange.feature.Descriptor.make("test_variable_a", 
    3737                                     Orange.feature.Type.Discrete, 
    3838                                     ["a", "b", "c", "d", "e"], None, 
  • docs/reference/rst/Orange.data.domain.rst

    r9840 r9936  
    3333variables including the class variable. Domains can be indexed by integer 
    3434indices, variable names or instances of 
    35 :obj:`Orange.data.variable.Variable`:: 
     35:obj:`Orange.feature.Descriptor`:: 
    3636 
    3737    >>> domain["feathers"] 
     
    159159meta attributes can be added and removed at any time:: 
    160160 
    161      >>> misses = Orange.data.variable.Continuous("misses") 
    162      >>> id = Orange.data.new_meta_id() 
     161     >>> misses = Orange.feature.Continuous("misses") 
     162     >>> id = Orange.feature.Descriptor.new_meta_id() 
    163163     >>> data.domain.add_meta(id, misses) 
    164164 
     
    205205 
    206206    new_domain = Orange.data.Domain(["feathers", "legs"], domain) 
    207     new_domain.add_meta(Orange.data.new_meta_id(), domain["type"]) 
    208     new_domain.add_meta(Orange.data.new_meta_id(), domain["legs"]) 
     207    new_domain.add_meta(Orange.feature.Descriptor.new_meta_id(), domain["type"]) 
     208    new_domain.add_meta(Orange.feature.Descriptor.new_meta_id(), domain["legs"]) 
    209209    new_domain.add_meta( 
    210         Orange.data.new_meta_id(), Orange.data.variable.Discrete("X")) 
     210        Orange.feature.Descriptor.new_meta_id(), Orange.feature.Discrete("X")) 
    211211    data2 = Orange.data.Table(new_domain, data) 
    212212 
     
    227227     .. attribute:: features 
    228228 
    229          List of domain attributes 
    230          (of type :obj:`Orange.data.variable.Variables`) without the class 
     229         Immutable list of domain attributes without the class 
    231230         variable. Read only. 
    232231 
     
    237236     .. attribute:: class_var 
    238237 
    239          The class variable (:obj:`~Orange.data.variable.Variable`) or 
     238         The class variable (:obj:`~Orange.feature.Descriptor`) or 
    240239         ``None``. Read only. 
    241240 
     
    255254         last one is used as the class variable. :: 
    256255 
    257              >>> a, b, c = [Orange.data.variable.Discrete(x) for x in "abc"] 
     256             >>> a, b, c = [Orange.feature.Discrete(x) for x in "abc"] 
    258257             >>> domain = Orange.data.Domain([a, b, c]) 
    259258             >>> domain.features 
     
    262261             EnumVariable 'c' 
    263262 
    264          :param variables: List of variables (instances of :obj:`~Orange.data.variable.Variable`) 
     263         :param variables: List of variables (instances of :obj:`~Orange.feature.Descriptor`) 
    265264         :type variables: list 
    266265         :param class_vars: A list of multiple classes; must be a keword argument 
     
    278277             EnumVariable 'c' 
    279278 
    280          :param features: List of features (instances of :obj:`~Orange.data.variable.Variable`) 
     279         :param features: List of features (instances of :obj:`~Orange.feature.Descriptor`) 
    281280         :type features: list 
    282281         :param class_variable: Class variable 
    283          :type class_variable: Orange.data.variable.Variable 
     282         :type class_variable: Orange.feature.Descriptor 
    284283         :param class_vars: A list of multiple classes; must be a keyword argument 
    285284         :type class_vars: list 
     
    296295             EnumVariable 'c' 
    297296 
    298          :param variables: List of variables (instances of :obj:`~Orange.data.variable.Variable`) 
     297         :param variables: List of variables (instances of :obj:`~Orange.feature.Descriptor`) 
    299298         :type features: list 
    300299         :param has_class: A flag telling whether the domain has a class 
     
    312311             >>> domain2 = orange.Domain(["a", b, c], domain) 
    313312 
    314          :param variables: List of variables (strings or instances of :obj:`~Orange.data.variable.Variable`) 
     313         :param variables: List of variables (strings or instances of :obj:`~Orange.feature.Descriptor`) 
    315314         :type variables: list 
    316315         :param source: An existing domain or a list of variables 
    317          :type source: Orange.data.Domain or list of :obj:`~Orange.data.variable.Variable` 
     316         :type source: Orange.data.Domain or list of :obj:`~Orange.feature.Descriptor` 
    318317         :param class_vars: A list of multiple classes; must be a keyword argument 
    319318         :type class_vars: list 
     
    327326             >>> domain2 = orange.Domain(["a", b, c], False, domain) 
    328327 
    329          :param variables: List of variables (strings or instances of :obj:`~Orange.data.variable.Variable`) 
     328         :param variables: List of variables (strings or instances of :obj:`~Orange.feature.Descriptor`) 
    330329         :type variables: list 
    331330         :param has_class: A flag telling whether the domain has a class 
    332331         :type has_class: bool 
    333332         :param source: An existing domain or a list of variables 
    334          :type source: Orange.data.Domain or list of :obj:`~Orange.data.variable.Variable` 
     333         :type source: Orange.data.Domain or list of :obj:`~Orange.feature.Descriptor` 
    335334         :param class_vars: A list of multiple classes; must be a keyword argument 
    336335         :type class_vars: list 
     
    347346         :type domain: :obj:`~Orange.variable.Domain` 
    348347         :param class_var: Class variable for the new domain 
    349          :type class_var: :obj:`~Orange.data.variable.Variable` or string 
     348         :type class_var: :obj:`~Orange.feature.Descriptor` or string 
    350349         :param class_vars: A list of multiple classes; must be a keyword argument 
    351350         :type class_vars: list 
     
    397396 
    398397         Register a meta attribute with the given id (see 
    399          :obj:`Orange.data.new_meta_id`). The same meta attribute should 
     398         :obj:`Orange.feature.Descriptor.new_meta_id`). The same meta attribute should 
    400399         have the same id in all domains in which it is registered. :: 
    401400 
    402              >>> newid = Orange.data.new_meta_id() 
    403              >>> domain.add_meta(newid, Orange.data.variable.String("origin")) 
     401             >>> newid = Orange.feature.Descriptor.new_meta_id() 
     402             >>> domain.add_meta(newid, Orange.feature.String("origin")) 
    404403             >>> data[55]["origin"] = "Nepal" 
    405404             >>> data[55] 
     
    416415         :type id: int 
    417416         :param variable: variable descriptor 
    418          :type variable: Orange.data.variable.Variable 
     417         :type variable: Orange.feature.Descriptor 
    419418         :param optional: indicates whether the meta attribute is optional 
    420419         :type optional: int 
     
    423422 
    424423         Add multiple meta attributes at once. The dictionary contains id's as 
    425          keys and variables (:obj:`~Orange.data.variable.Variable`) as the 
     424         keys and variables (:obj:`~Orange.feature.Descriptor`) as the 
    426425         corresponding values. The following example shows how to add all 
    427426         meta attributes from another domain:: 
     
    442441 
    443442         :param attribute: attribute(s) to be removed, given as name, id, variable descriptor or a list of them 
    444          :type attribute: string, int, Orange.data.variable.Variable; or a list 
     443         :type attribute: string, int, Orange.feature.Descriptor; or a list 
    445444 
    446445     .. method:: has_attribute(attribute) 
     
    450449 
    451450         :param attribute: attribute to be checked 
    452          :type attribute: string, int, Orange.data.variable.Variable 
     451         :type attribute: string, int, Orange.feature.Descriptor 
    453452         :rtype: bool 
    454453 
     
    458457 
    459458         :param attribute: name or variable descriptor of the attribute 
    460          :type attribute: string or Orange.data.variable.Variable 
     459         :type attribute: string or Orange.feature.Descriptor 
    461460         :rtype: int 
    462461 
     
    467466         :param attribute: name or id of the attribute 
    468467         :type attribute: string or int 
    469          :rtype: Orange.data.variable.Variable 
     468         :rtype: Orange.feature.Descriptor 
    470469 
    471470     .. method:: get_metas() 
     
    492491 
    493492         :param attribute: attribute to be checked 
    494          :type attribute: string, int, Orange.data.variable.Variable 
     493         :type attribute: string, int, Orange.feature.Descriptor 
    495494         :rtype: bool 
  • docs/reference/rst/Orange.data.formats.rst

    r9884 r9928  
    44Loading and saving data 
    55======================= 
     6 
     7.. _tab-delimited: 
    68 
    79Tab-delimited format 
     
    2022Feature types 
    2123------------- 
    22  * discrete (or d) - imported as Orange.data.variable.Discrete 
    23  * continuous (or c) - imported as Orange.data.variable.Continuous 
    24  * string - imported as Orange.data.variable.String 
     24 * discrete (or d) - imported as :obj:`Orange.feature.Discrete` 
     25 * continuous (or c) - imported as :obj:`Orange.feature.Continuous` 
     26 * string - imported as :obj:`Orange.feature.String` 
    2527 * basket - used for storing sparse data. More on basket formats in a dedicated section. 
    2628 
  • docs/reference/rst/Orange.data.instance.rst

    r9788 r9936  
    5353attributes. Meta attributes are hence not addressed by positions, 
    5454but by their id's, which are represented by negative indices. Id's are 
    55 generated by function :obj:`Orange.data.variable.new_meta_id()`. Id's can 
     55generated by function :obj:`Orange.feature.Descriptor.new_meta_id()`. Id's can 
    5656be reused for multiple domains. 
    5757 
     
    126126 
    127127    ok = orange.EnumVariable("ok?", values=["no", "yes"]) 
    128     ok_id = Orange.data.new_meta_id() 
     128    ok_id = Orange.feature.Descriptor.new_meta_id() 
    129129    data.domain.addmeta(ok_id, ok) 
    130130    data[0][ok_id] = "yes" 
     
    275275        Return a dictionary containing meta values of the data 
    276276        instance. The argument ``key_type`` can be ``int`` (default), 
    277         ``str`` or :obj:`Orange.data.variable.Variable` and 
     277        ``str`` or :obj:`Orange.feature.Descriptor` and 
    278278        determines whether 
    279279        the dictionary keys are meta ids, variables names or 
     
    288288            print example.getmetas(orange.Variable) 
    289289 
    290         :param key_type: the key type; either ``int``, ``str`` or :obj:`~Orange.data.variable.Variable` 
     290        :param key_type: the key type; either ``int``, ``str`` or :obj:`~Orange.feature.Descriptor` 
    291291        :type key_type: ``type`` 
    292292 
     
    299299        :param optional: tells whether to return optional or non-optional attributes 
    300300        :type optional: ``bool`` 
    301         :param key_type: the key type; either ``int``, ``str`` or :obj:`~Orange.data.variable.Variable` 
     301        :param key_type: the key type; either ``int``, ``str`` or :obj:`~Orange.feature.Descriptor` 
    302302        :type key_type: `type`` 
    303303 
     
    308308 
    309309        :param meta_attr: meta attribute 
    310         :type meta_attr: :obj:`id`, ``str`` or :obj:`~Orange.data.variable.Variable` 
     310        :type meta_attr: :obj:`id`, ``str`` or :obj:`~Orange.feature.Descriptor` 
    311311 
    312312    .. method:: remove_meta(meta_attr) 
     
    315315 
    316316        :param meta_attr: meta attribute 
    317         :type meta_attr: :obj:`id`, ``str`` or :obj:`~Orange.data.variable.Variable` 
     317        :type meta_attr: :obj:`id`, ``str`` or :obj:`~Orange.feature.Descriptor` 
    318318 
    319319    .. method:: get_weight(meta_attr) 
     
    323323 
    324324        :param meta_attr: meta attribute 
    325         :type meta_attr: :obj:`id`, ``str`` or :obj:`~Orange.data.variable.Variable` 
     325        :type meta_attr: :obj:`id`, ``str`` or :obj:`~Orange.feature.Descriptor` 
    326326 
    327327    .. method:: set_weight(meta_attr, weight=1) 
     
    330330 
    331331        :param meta_attr: meta attribute 
    332         :type meta_attr: :obj:`id`, ``str`` or :obj:`~Orange.data.variable.Variable` 
     332        :type meta_attr: :obj:`id`, ``str`` or :obj:`~Orange.feature.Descriptor` 
    333333        :param weight: weight of instance 
    334334        :type weight: ``float`` 
  • docs/reference/rst/Orange.data.table.rst

    r9885 r9927  
    483483            the domain is used. Note that the values of discrete 
    484484            features are not ordered alphabetically but according to 
    485             the :obj:`Orange.data.variable.Discrete.values`. 
     485            the :obj:`Orange.feature.Discrete.values`. 
    486486 
    487487            This sorts the data from the bridges data set by the lengths 
  • docs/reference/rst/Orange.data.value.rst

    r9756 r9927  
    2525          (:obj:`variable` is not :obj:`None`), `value` is a string with 
    2626          the symbolic value (as retrieved from 
    27           :obj:`Orange.data.variable.Discrete.values`). 
     27          :obj:`Orange.feature.Discrete.values`). 
    2828 
    2929        * If it is discrete and the variable descriptor is unknown, 
     
    3737 
    3838        Stores a value that corresponds to a variable that is neither 
    39         :obj:`Orange.data.variable.Discrete` nor 
    40         :obj:`Orange.data.variable.Continuous` or a distribution of a 
     39        :obj:`Orange.feature.Discrete` nor 
     40        :obj:`Orange.feature.Continuous` or a distribution of a 
    4141        discrete or continuous value. 
    4242 
    4343        This attribute is most often used for values of 
    44         :obj:`Orange.data.variable.StringVariable`; in that case `svalue` 
     44        :obj:`Orange.feature.StringVariable`; in that case `svalue` 
    4545        is an instance of :obj:`Orange.data.StringValue`. Distributions 
    4646        are seldom used; when `svalue` contains a distribution, it is 
     
    5656 
    5757        Read-only descriptor that gives the variable type. Can be 
    58         :obj:`Orange.data.Type.Discrete`, :obj:`Orange.data.Type.Continuous`, 
    59         :obj:`Orange.data.Type.String` or :obj:`Orange.data.Type.Other`. 
     58        :obj:`Orange.feature.Type.Discrete`, :obj:`Orange.feature.Type.Continuous`, 
     59        :obj:`Orange.feature.Type.String` or :obj:`Orange.feature.Type.Other`. 
    6060 
    6161    .. attribute:: value_type 
     
    7474 
    7575             import Orange 
    76              v = Orange.data.variable.Discrete("fruit", values=["plum", "orange", "apple"]) 
     76             v = Orange.feature.Discrete("fruit", values=["plum", "orange", "apple"]) 
    7777             an_apple = Orange.data.Value(v, "apple") 
    7878             another_apple = Orange.data.Value(v, 2) 
    7979             unknown_fruit = Orange.data.Value(v) 
    8080 
    81              v2 = Orange.data.variable.Continuous("iq") 
     81             v2 = Orange.feature.Continuous("iq") 
    8282             genius = Orange.data.Value(v2, 180) 
    8383             troll = Orange.data.Value(v2, "42") 
     
    8585 
    8686        :param variable: variable descriptor 
    87         :type variables: Orange.data.variable.Variable 
     87        :type variables: Orange.feature.Descriptor 
    8888        :param value: A value 
    8989        :type value: int, float or string, or another type accepted by descriptor 
     
    131131order is unambiguous. Here are two such values:: 
    132132 
    133     deg3 = Orange.data.variable.Discrete( 
     133    deg3 = Orange.feature.Discrete( 
    134134        "deg3", values=["little", "medium", "big"]) 
    135     deg4 = orange.data.variable.Discrete( 
     135    deg4 = orange.feature.Discrete( 
    136136        "deg4", values=["tiny", "little", "big", "huge"]) 
    137137    val3 = orange.Value(deg3) 
  • docs/reference/rst/Orange.feature.descriptor.rst

    r9897 r9936  
    3131    .. attribute:: var_type 
    3232 
    33         Variable type; it can be :obj:`~Orange.data.Type.Discrete`, 
    34         :obj:`~Orange.data.Type.Continuous`, 
    35         :obj:`~Orange.data.Type.String` or :obj:`~Orange.data.Type.Other`. 
     33        Variable type; it can be :obj:`~Orange.feature.Type.Discrete`, 
     34        :obj:`~Orange.feature.Type.Continuous`, 
     35        :obj:`~Orange.feature.Type.String` or :obj:`~Orange.feature.Type.Other`. 
    3636 
    3737    .. attribute:: get_value_from 
     
    5959        For instance, when a tab-delimited contains meta attributes and 
    6060        the existing variables are reused, they will have this id 
    61         (instead of a new one assigned by :obj:`Orange.data.new_meta_id()`). 
     61        (instead of a new one assigned by :obj:`Orange.feature.Descriptor.new_meta_id()`). 
    6262 
    6363    .. attribute:: attributes 
     
    243243-------------------- 
    244244 
    245 There are situations when variable descriptors need to be reused. Typically, the 
    246 user loads some training examples, trains a classifier, and then loads a separate 
    247 test set. For the classifier to recognize the variables in the second data set, 
    248 the descriptors, not just the names, need to be the same. 
    249  
    250 When constructing new descriptors for data read from a file or during unpickling, 
    251 Orange checks whether an appropriate descriptor (with the same name and, in case 
    252 of discrete variables, also values) already exists and reuses it. When new 
    253 descriptors are constructed by explicitly calling the above constructors, this 
    254 always creates new descriptors and thus new variables, although a variable with 
    255 the same name may already exist. 
    256  
    257 The search for an existing variable is based on four attributes: the variable's name, 
    258 type, ordered values, and unordered values. As for the latter two, the values can 
    259 be explicitly ordered by the user, e.g. in the second line of the tab-delimited 
    260 file. For instance, sizes can be ordered as small, medium, or big. 
    261  
    262 The search for existing variables can end with one of the following statuses. 
    263  
    264 .. data:: MakeStatus.NotFound (4) 
     245There are situations when variable descriptors need to be 
     246reused. Typically, the user loads some training examples, trains a 
     247classifier, and then loads a separate test set. For the classifier to 
     248recognize the variables in the second data set, the descriptors, not 
     249just the names, need to be the same. 
     250 
     251When constructing new descriptors for data read from a file or during 
     252unpickling, Orange checks whether an appropriate descriptor (with the same 
     253name and, in case of discrete variables, also values) already exists and 
     254reuses it. When new descriptors are constructed by explicitly calling 
     255the above constructors, this always creates new descriptors and thus 
     256new variables, although a variable with the same name may already exist. 
     257 
     258The search for an existing variable is based on four attributes: the 
     259variable's name, type, ordered values, and unordered values. As for the 
     260latter two, the values can be explicitly ordered by the user, e.g. in 
     261the second line of the tab-delimited file. For instance, sizes can be 
     262ordered as small, medium, or big. 
     263 
     264The search for existing variables can end with one of the following 
     265statuses. 
     266 
     267.. data:: Descriptor.MakeStatus.NotFound (4) 
    265268 
    266269    The variable with that name and type does not exist. 
    267270 
    268 .. data:: MakeStatus.Incompatible (3) 
     271.. data:: Descriptor.MakeStatus.Incompatible (3) 
    269272 
    270273    There are variables with matching name and type, but their 
     
    276279    does not matter. The formal rule is thus that the values are compatible iff ``existing_values[:len(ordered_values)] == ordered_values[:len(existing_values)]``. 
    277280 
    278 .. data:: MakeStatus.NoRecognizedValues (2) 
     281.. data:: Descriptor.MakeStatus.NoRecognizedValues (2) 
    279282 
    280283    There is a matching variable, yet it has none of the values that the new 
     
    288291    some from the old. 
    289292 
    290 .. data:: MakeStatus.MissingValues (1) 
     293.. data:: Descriptor.MakeStatus.MissingValues (1) 
    291294 
    292295    There is a matching variable with some of the values that the new one 
     
    295298    be values which occur in one set but not in the other. 
    296299 
    297 .. data:: MakeStatus.OK (0) 
     300.. data:: Descriptor.MakeStatus.OK (0) 
    298301 
    299302    There is a perfect match which contains all the prescribed values in the 
     
    301304 
    302305Continuous variables can obviously have only two statuses, 
    303 :obj:`~MakeStatus.NotFound` or :obj:`~MakeStatus.OK`. 
     306:obj:`~Descriptor.MakeStatus.NotFound` or :obj:`~Descriptor.MakeStatus.OK`. 
    304307 
    305308When loading the data using :obj:`Orange.data.Table`, Orange takes the safest 
    306309approach and, by default, reuses everything that is compatible up to 
    307 and including :obj:`~MakeStatus.NoRecognizedValues`. Unintended reuse would be obvious from the 
     310and including :obj:`~Descriptor.MakeStatus.NoRecognizedValues`. Unintended reuse would be obvious from the 
    308311variable having too many values, which the user can notice and fix. More on that 
    309312in the page on :doc:`Orange.data.formats`. 
     
    311314There are two functions for reusing the variables instead of creating new ones. 
    312315 
    313 .. function:: make(name, type, ordered_values, unordered_values[, create_new_on]) 
     316.. function:: Descriptor.make(name, type, ordered_values, unordered_values[, create_new_on]) 
    314317 
    315318    Find and return an existing variable or create a new one if none of the existing 
     
    317320 
    318321    The optional `create_new_on` specifies the status at which a new variable is 
    319     created. The status must be at most :obj:`~MakeStatus.Incompatible` since incompatible (or 
     322    created. The status must be at most :obj:`~Descriptor.MakeStatus.Incompatible` since incompatible (or 
    320323    non-existing) variables cannot be reused. If it is set lower, for instance 
    321     to :obj:`~MakeStatus.MissingValues`, a new variable is created even if there exists 
    322     a variable which is only missing the same values. If set to :obj:`~MakeStatus.OK`, the function 
     324    to :obj:`~Descriptor.MakeStatus.MissingValues`, a new variable is created even if there exists 
     325    a variable which is only missing the same values. If set to :obj:`~Descriptor.MakeStatus.OK`, the function 
    323326    always creates a new variable. 
    324327 
    325328    The function returns a tuple containing a variable descriptor and the 
    326329    status of the best matching variable. So, if ``create_new_on`` is set to 
    327     :obj:`~MakeStatus.MissingValues`, and there exists a variable whose status is, say, 
    328     :obj:`~MakeStatus.NoRecognizedValues`, a variable would be created, while the second 
    329     element of the tuple would contain :obj:`~MakeStatus.NoRecognizedValues`. If, on the other 
     330    :obj:`~Descriptor.MakeStatus.MissingValues`, and there exists a variable whose status is, say, 
     331    :obj:`~Descriptor.MakeStatus.NoRecognizedValues`, a variable would be created, while the second 
     332    element of the tuple would contain :obj:`~Descriptor.MakeStatus.NoRecognizedValues`. If, on the other 
    330333    hand, there exists a variable which is perfectly OK, its descriptor is 
    331     returned and the returned status is :obj:`~MakeStatus.OK`. The function returns no 
     334    returned and the returned status is :obj:`~Descriptor.MakeStatus.OK`. The function returns no 
    332335    indicator whether the returned variable is reused or not. This can be, 
    333336    however, read from the status code: if it is smaller than the specified 
     
    336339    The exception to the rule is when ``create_new_on`` is OK. In this case, the 
    337340    function does not search through the existing variables and cannot know the 
    338     status, so the returned status in this case is always :obj:`~MakeStatus.OK`. 
     341    status, so the returned status in this case is always :obj:`~Descriptor.MakeStatus.OK`. 
    339342 
    340343    :param name: Descriptor name 
     
    349352    :return_type: a tuple (:class:`~Descriptor`, int) 
    350353 
    351 .. function:: retrieve(name, type, ordered_values, onordered_values[, create_new_on]) 
     354.. function:: Descriptor.retrieve(name, type, ordered_values, onordered_values[, create_new_on]) 
    352355 
    353356    Find and return an existing variable, or :obj:`None` if no match is found. 
     
    369372:func:`make` can be used for the construction of new variables. :: 
    370373 
    371     >>> v1, s = Orange.feature.make("a", Orange.data.Type.Discrete, ["a", "b"]) 
     374    >>> v1, s = Orange.feature.Descriptor.make("a", Orange.feature.Type.Discrete, ["a", "b"]) 
    372375    >>> print s, v1.values 
    373376    NotFound <a, b> 
    374377 
    375 A new variable was created and the status is :obj:`~Orange.data.variable 
    376 .MakeStatus.NotFound`. :: 
    377  
    378     >>> v2, s = Orange.feature.make("a", Orange.data.Type.Discrete, ["a"], ["c"]) 
     378A new variable was created and the status is :obj:`~Descriptor.MakeStatus.NotFound`. :: 
     379 
     380    >>> v2, s = Orange.feature.Descriptor.make("a", Orange.feature.Type.Discrete, ["a"], ["c"]) 
    379381    >>> print s, v2 is v1, v1.values 
    380382    MissingValues True <a, b, c> 
    381383 
    382 The status is :obj:`~MakeStatus.MissingValues`, 
     384The status is :obj:`~Descriptor.MakeStatus.MissingValues`, 
    383385yet the variable is reused (``v2 is v1``). ``v1`` gets a new value, 
    384386``"c"``, which was given as an unordered value. It does 
    385387not matter that the new variable does not need the value ``b``. :: 
    386388 
    387     >>> v3, s = Orange.feature.make("a", Orange.data.Type.Discrete, ["a", "b", "c", "d"]) 
     389    >>> v3, s = Orange.feature.Descriptor.make("a", Orange.feature.Type.Discrete, ["a", "b", "c", "d"]) 
    388390    >>> print s, v3 is v1, v1.values 
    389391    MissingValues True <a, b, c, d> 
     
    392394ordered values. :: 
    393395 
    394     >>> v4, s = Orange.feature.make("a", Orange.data.Type.Discrete, ["b"]) 
     396    >>> v4, s = Orange.feature.Descriptor.make("a", Orange.feature.Type.Discrete, ["b"]) 
    395397    >>> print s, v4 is v1, v1.values, v4.values 
    396398    Incompatible, False, <b>, <a, b, c, d> 
     
    398400The new variable needs to have ``b`` as the first value, so it is incompatible 
    399401with the existing variables. The status is 
    400 :obj:`~MakeStatus.Incompatible` and 
     402:obj:`~Descriptor.MakeStatus.Incompatible` and 
    401403a new variable is created; the two variables are not equal and have 
    402404different lists of values. :: 
    403405 
    404     >>> v5, s = Orange.feature.make("a", Orange.data.Type.Discrete, None, ["c", "a"]) 
     406    >>> v5, s = Orange.feature.Descriptor.make("a", Orange.feature.Type.Discrete, None, ["c", "a"]) 
    405407    >>> print s, v5 is v1, v1.values, v5.values 
    406408    OK True <a, b, c, d> <a, b, c, d> 
    407409 
    408410The new variable has values ``c`` and ``a``, but the order is not important, 
    409 so the existing attribute is :obj:`~MakeStatus.OK`. :: 
    410  
    411     >>> v6, s = Orange.feature.make("a", Orange.data.Type.Discrete, None, ["e"]) "a"]) 
     411so the existing attribute is :obj:`~Descriptor.MakeStatus.OK`. :: 
     412 
     413    >>> v6, s = Orange.feature.Descriptor.make("a", Orange.feature.Type.Discrete, None, ["e"]) "a"]) 
    412414    >>> print s, v6 is v1, v1.values, v6.values 
    413415    NoRecognizedValues True <a, b, c, d, e> <a, b, c, d, e> 
    414416 
    415417The new variable has different values than the existing variable (status 
    416 is :obj:`~MakeStatus.NoRecognizedValues`), 
     418is :obj:`~Descriptor.MakeStatus.NoRecognizedValues`), 
    417419but the existing one is nonetheless reused. Note that we 
    418420gave ``e`` in the list of unordered values. If it was among the ordered, the 
    419421reuse would fail. :: 
    420422 
    421     >>> v7, s = Orange.feature.make("a", Orange.data.Type.Discrete, None, 
     423    >>> v7, s = Orange.feature.Descriptor.make("a", Orange.feature.Type.Discrete, None, 
    422424            ["f"], Orange.feature.MakeStatus.NoRecognizedValues))) 
    423425    >>> print s, v7 is v1, v1.values, v7.values 
     
    428430the same as before:: 
    429431 
    430     >>> v8, s = Orange.feature.make("a", Orange.data.Type.Discrete, 
     432    >>> v8, s = Orange.feature.Descriptor.make("a", Orange.feature.Type.Discrete, 
    431433            ["a", "b", "c", "d", "e"], None, Orange.feature.MakeStatus.OK) 
    432434    >>> print s, v8 is v1, v1.values, v8.values 
  • docs/reference/rst/Orange.feature.discretization.rst

    r9900 r9927  
    342342continuous variable by adding a prefix ``D_``. The values of the new attributes 
    343343are computed automatically when they are needed using a transformation 
    344 function :obj:`~Orange.data.variable.Variable.get_value_from` 
    345 (see :class:`Orange.data.variable.Variable`) which encodes the discretization:: 
     344function :obj:`~Orange.feature.Descriptor.get_value_from` 
     345(see :class:`Orange.feature.Descriptor`) which encodes the discretization:: 
    346346 
    347347    >>> sep_w 
  • docs/reference/rst/Orange.multilabel.rst

    r9505 r9928  
    22Multi-label classification (``multilabel``) 
    33########################################### 
     4 
     5`Multi-label classification <http://en.wikipedia 
     6.org/wiki/Multi-label_classification>`_ is a machine learning prediction 
     7problem in which multiple binary variables (i.e. labels) are being predicted. 
     8Orange supports such a task, although the set of available methods is 
     9currently rather limited. 
     10 
     11Multi-label data is represented as :ref:`multi-target data <multiple-classes>` 
     12with discrete binary classes with values '0' and '1'. Multi-target data is 
     13also supported by Orange's tab file format 
     14using :ref:`multiclass directive <tab-delimited>`. 
    415 
    516.. automodule:: Orange.multilabel 
  • docs/reference/rst/Orange.multitarget.rst

    r9553 r9928  
    33########################################### 
    44 
    5 This module contains methods for working with 
    6 :ref:`multi-target data <multiple-classes>`. 
     5Multi-target prediction tries to achieve better prediction accuracy or speed 
     6through prediction of multiple dependent variable at once. It works on 
     7:ref:`multi-target data <multiple-classes>`, which is also supported by 
     8Orange's tab file format using :ref:`multiclass directive <tab-delimited>`. 
    79 
    810.. toctree:: 
  • docs/reference/rst/code/datatable1.py

    r9883 r9927  
    1010values = ["1", "2", "3", "4"] 
    1111 
    12 features = [Orange.data.variable.Discrete(name, values = values[:card]) 
     12features = [Orange.feature.Discrete(name, values = values[:card]) 
    1313              for name, card in zip("abcdef", cards)] 
    14 classattr = Orange.data.variable.Discrete("y", values = ["0", "1"]) 
     14classattr = Orange.feature.Discrete("y", values = ["0", "1"]) 
    1515domain = Orange.data.Domain(features + [classattr]) 
    1616data = Orange.data.Table(domain) 
     
    3737 
    3838import numpy 
    39 d = Orange.data.Domain([Orange.data.variable.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/datatable2.py

    r9372 r9927  
    77import Orange 
    88 
    9 domain = Orange.data.Domain([Orange.data.variable.Continuous()]) 
     9domain = Orange.data.Domain([Orange.feature.Continuous()]) 
    1010data = Orange.data.Table(domain) 
    1111for i in range(10): 
  • docs/reference/rst/code/discretization.py

    r9812 r9927  
    8282 
    8383 
    84 newclass = Orange.data.variable.Discrete("is versicolor", values = ["no", "yes"]) 
     84newclass = Orange.feature.Discrete("is versicolor", values = ["no", "yes"]) 
    8585newclass.get_value_from = lambda ex, w: ex["iris"]=="Iris-versicolor" 
    8686newdomain = Orange.data.Domain(data.domain.attributes, newclass) 
  • docs/reference/rst/code/generate_multitarget.py

    r9604 r9927  
    1313 
    1414    """ 
    15     vars = [Orange.data.variable.Continuous('X%i' % i) for i in range(1, 4)] 
    16     cvars = [Orange.data.variable.Continuous('Y%i' % i) for i in range(1, 5)] 
     15    vars = [Orange.feature.Continuous('X%i' % i) for i in range(1, 4)] 
     16    cvars = [Orange.feature.Continuous('Y%i' % i) for i in range(1, 5)] 
    1717    domain = Orange.data.Domain(vars, False, class_vars=cvars) 
    1818    data = Orange.data.Table(domain) 
  • docs/reference/rst/code/instance-metavar.py

    r9638 r9936  
    22import Orange 
    33lenses = Orange.data.Table("lenses") 
    4 id = Orange.data.new_meta_id() 
     4id = Orange.feature.Descriptor.new_meta_id() 
    55for inst in lenses: 
    66    inst[id] = random.random() 
  • docs/reference/rst/code/instance_merge.py

    r9372 r9936  
    1313 
    1414a1, a3 = data2.domain.attributes 
    15 n1 = Orange.data.variable.Continuous("n1") 
    16 n2 = Orange.data.variable.Continuous("n2") 
     15n1 = Orange.feature.Continuous("n1") 
     16n2 = Orange.feature.Continuous("n2") 
    1717 
    1818new_domain = Orange.data.Domain([a1, a3, m1, n1]) 
    1919new_domain.addmeta(m2i, m2) 
    20 new_domain.addmeta(Orange.data.new_meta_id(), a2) 
    21 new_domain.addmeta(Orange.data.new_meta_id(), n2) 
     20new_domain.addmeta(Orange.feature.Descriptor.new_meta_id(), a2) 
     21new_domain.addmeta(Orange.feature.Descriptor.new_meta_id(), n2) 
    2222 
    2323merge = Orange.data.Instance(new_domain, [data1[0], data2[0]]) 
  • docs/reference/rst/code/knnInstanceDistance.py

    r9823 r9936  
    66nnc.distanceConstructor = Orange.core.ExamplesDistanceConstructor_Euclidean() 
    77 
    8 did = Orange.data.new_meta_id() 
     8did = Orange.feature.Descriptor.new_meta_id() 
    99nn = nnc(lenses, 0, did) 
    1010 
  • docs/reference/rst/code/lookup-lookup.py

    r9823 r9927  
    1111a, b, e = monks.domain["a"], monks.domain["b"], monks.domain["e"] 
    1212 
    13 ab = Orange.data.variable.Discrete("a==b", values = ["no", "yes"]) 
     13ab = Orange.feature.Discrete("a==b", values = ["no", "yes"]) 
    1414ab.get_value_from = Orange.classification.lookup.ClassifierByLookupTable(ab, a, b, 
    1515                    ["yes", "no", "no",  "no", "yes", "no",  "no", "no", "yes"]) 
    1616 
    17 e1 = Orange.data.variable.Discrete("e==1", values = ["no", "yes"]) 
     17e1 = Orange.feature.Discrete("e==1", values = ["no", "yes"]) 
    1818e1.get_value_from = Orange.classification.lookup.ClassifierByLookupTable(e1, e, 
    1919                    ["yes", "no", "no", "no", "?"]) 
  • docs/reference/rst/code/lookup-table.py

    r9372 r9927  
    2424print 
    2525 
    26 y2 = Orange.data.variable.Discrete("y2", values = ["0", "1"]) 
     26y2 = Orange.feature.Discrete("y2", values = ["0", "1"]) 
    2727abe2 = Orange.classification.lookup.LookupLearner(y2, [a, b, e], table) 
    2828for i in abe2.sorted_examples[:10]: 
     
    3030print 
    3131 
    32 y2 = Orange.data.variable.Discrete("y2", values = ["0", "1"]) 
     32y2 = Orange.feature.Discrete("y2", values = ["0", "1"]) 
    3333abe2 = Orange.classification.lookup.LookupLearner(y2, [a, b], table) 
    3434for i in abe2.sorted_examples: 
  • docs/reference/rst/code/scoring-info-lenses.py

    r9823 r9936  
    5353 
    5454values = ["v%i" % i for i in range(len(lenses.domain[2].values)*len(lenses.domain[3].values))] 
    55 cartesian = Orange.data.variable.Discrete("cart", values = values) 
     55cartesian = Orange.feature.Discrete("cart", values = values) 
    5656cartesian.get_value_from = Orange.classification.lookup.ClassifierByLookupTable(cartesian, lenses.domain[2], lenses.domain[3], values) 
    5757 
    5858print "Information gain of Cartesian product of %s and %s: %6.4f" % (lenses.domain[2].name, lenses.domain[3].name, meas(cartesian, lenses)) 
    5959 
    60 mid = Orange.data.new_meta_id() 
    61 lenses.domain.add_meta(mid, Orange.data.variable.Discrete(values = ["v0", "v1"])) 
     60mid = Orange.feature.Descriptor.new_meta_id() 
     61lenses.domain.add_meta(mid, Orange.feature.Discrete(values = ["v0", "v1"])) 
    6262lenses.add_meta_attribute(mid) 
    6363 
  • pylintrc

    r9926 r9930  
    9090 
    9191# Regular expression which should only match correct instance attribute names 
    92 attr-rgx=[a-z_][a-z0-9_]{2,30}$ 
     92attr-rgx=[a-z_][a-z0-9_]{0,30}$ 
    9393 
    9494# Regular expression which should only match correct argument names 
    95 argument-rgx=[a-z_][a-z0-9_]{2,30}$ 
     95argument-rgx=[a-z_][a-z0-9_]{0,30}$ 
    9696 
    9797# Regular expression which should only match correct variable names 
  • source/orange/_aliases.txt

    r9921 r9935  
    7676impute_class imputeClass 
    7777 
    78 Variable 
    79 retrieve get_existing 
  • source/orange/lib_kernel.cpp

    r9532 r9935  
    280280} 
    281281 
     282 
     283PyObject *Variable_retrieve(PyObject *, PyObject *args) PYARGS(METH_VARARGS | METH_STATIC, "(name, type[, fixedOrderValues[, otherValues, failOn]]) -> (Variable|None, status)") 
     284{ 
     285    return Variable_getExisting(NULL, args); 
     286} 
     287 
     288 
     289PyObject *newmetaid(PyObject *, PyObject *args); 
     290 
     291PyObject *Variable_new_meta_id(PyObject *, PyObject *args)  PYARGS(METH_VARARGS | METH_STATIC, "([Variable]) -> int") 
     292{ 
     293    return newmetaid(NULL, args); 
     294} 
    282295 
    283296PyObject *Variable_make(PyObject *, PyObject *args) PYARGS(METH_VARARGS | METH_STATIC, "(name, type[, fixedOrderValues[, otherValues, createNewOn]]) -> (Variable|None, status)") 
Note: See TracChangeset for help on using the changeset viewer.