Ignore:
Files:
19 added
8 deleted
80 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

    r9898 r9932  
    3434 
    3535# Built documentation. 
    36 docs/reference/html 
     36docs/*/html 
    3737 
    3838# Files generated by tests. 
     
    5252docs/tutorial/rst/code/tree.dot 
    5353 
     54source/orangeqt/Makefile 
  • Orange/__init__.py

    r9943 r9944  
    1919_import("data.io") 
    2020_import("data.sample") 
    21 _import("data.variable") 
    2221_import("data.discretization") 
    2322 
  • Orange/associate/__init__.py

    r9671 r9919  
    149149 
    150150This way of representing the itemsets is memory efficient and faster than using 
    151 objects like :obj:`~Orange.data.variable.Variable` and :obj:`~Orange.data.Instance`. 
     151objects like :obj:`~Orange.feature.Descriptor` and :obj:`~Orange.data.Instance`. 
    152152 
    153153.. _non-sparse-examples: 
  • Orange/classification/logreg.py

    r9878 r9936  
    4646    :type domain: :class:`Orange.data.Domain` 
    4747    """ 
    48     return any(at.var_type == Orange.data.Type.Discrete 
     48    return any(at.var_type == Orange.feature.Type.Discrete 
    4949               for at in domain.features) 
    5050 
     
    132132        else: 
    133133            lr = learner(instances, weight) 
    134         while isinstance(lr, Orange.data.variable.Variable): 
     134        while isinstance(lr, Orange.feature.Descriptor): 
    135135            if isinstance(lr.getValueFrom, Orange.core.ClassifierFromVar) and isinstance(lr.getValueFrom.transformer, Orange.core.Discrete2Continuous): 
    136136                lr = lr.getValueFrom.variable 
     
    215215                # za vsak atribut kreiraj nov newExampleTable new_data 
    216216                # v dataOrig, dataFinal in new_data dodaj nov atribut -- continuous variable 
    217                 if at.var_type == Orange.data.Type.Continuous: 
    218                     at_disc = Orange.data.variable.Continuous(at.name+ "Disc") 
     217                if at.var_type == Orange.feature.Type.Continuous: 
     218                    at_disc = Orange.feature.Continuous(at.name+ "Disc") 
    219219                    new_domain = Orange.data.Domain(data.domain.features+[at_disc,data.domain.class_var]) 
    220220                    new_domain.addmetas(data.domain.getmetas()) 
     
    228228                        d[at] = 0 
    229229                        d[weight_id] = 0.000001*data[i][weight_id] 
    230                 elif at.var_type == Orange.data.Type.Discrete: 
     230                elif at.var_type == Orange.feature.Type.Discrete: 
    231231                # v dataOrig, dataFinal in new_data atributu "at" dodaj ee  eno  vreednost, ki ima vrednost kar  ime atributa +  "X" 
    232                     at_new = Orange.data.variable.Discrete(at.name, values = at.values + [at.name+"X"]) 
     232                    at_new = Orange.feature.Discrete(at.name, values = at.values + [at.name+"X"]) 
    233233                    new_domain = Orange.data.Domain(filter(lambda x: x!=at, data.domain.features)+[at_new,data.domain.class_var]) 
    234234                    new_domain.addmetas(data.domain.getmetas()) 
     
    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) 
     
    335335                # za vsak atribut kreiraj nov newExampleTable newData 
    336336                # v dataOrig, dataFinal in newData dodaj nov atribut -- continuous variable 
    337                 if at.var_type == Orange.data.Type.Continuous: 
    338                     atDisc = Orange.data.variable.Continuous(at.name + "Disc") 
     337                if at.var_type == Orange.feature.Type.Continuous: 
     338                    atDisc = Orange.feature.Continuous(at.name + "Disc") 
    339339                    newDomain = Orange.data.Domain(orig_data.domain.features+[atDisc,data.domain.class_var]) 
    340340                    newDomain.addmetas(newData.domain.getmetas()) 
     
    351351                        d[weightID] = 100*data[i][weightID] 
    352352                         
    353                 elif at.var_type == Orange.data.Type.Discrete: 
     353                elif at.var_type == Orange.feature.Type.Discrete: 
    354354                # v dataOrig, dataFinal in newData atributu "at" dodaj ee  eno  vreednost, ki ima vrednost kar  ime atributa +  "X" 
    355                     at_new = Orange.data.variable.Discrete(at.name, values = at.values + [at.name+"X"]) 
     355                    at_new = Orange.feature.Discrete(at.name, values = at.values + [at.name+"X"]) 
    356356                    newDomain = Orange.data.Domain(filter(lambda x: x!=at, orig_data.domain.features)+[at_new,orig_data.domain.class_var]) 
    357357                    newDomain.addmetas(orig_data.domain.getmetas()) 
     
    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) 
     
    455455        for i in range(len(data.domain.features)): 
    456456          a = data.domain.features[i] 
    457           if a.var_type == Orange.data.Type.Discrete: 
     457          if a.var_type == Orange.feature.Type.Discrete: 
    458458            for m in ml: 
    459459              m[i] = a.values.index(m[i]) 
     
    546546        ml = data.native(0) 
    547547        for i,a in enumerate(data.domain.features): 
    548           if a.var_type == Orange.data.Type.Discrete: 
     548          if a.var_type == Orange.feature.Type.Discrete: 
    549549            for m in ml: 
    550550              m[i] = a.values.index(m[i]) 
     
    802802            # deletion of attribute 
    803803 
    804             if worstAt.var_type==Orange.data.Type.Continuous: 
     804            if worstAt.var_type==Orange.feature.Type.Continuous: 
    805805                P=lchisqprob(minG,1); 
    806806            else: 
     
    850850            continue 
    851851 
    852         if bestAt.var_type==Orange.data.Type.Continuous: 
     852        if bestAt.var_type==Orange.feature.Type.Continuous: 
    853853            P=lchisqprob(maxG,1); 
    854854        else: 
  • Orange/classification/lookup.py

    r9671 r9919  
    1919 
    2020A natural habitat for these classifiers is feature construction: 
    21 they usually reside in :obj:`~Orange.data.variable.Variable.get_value_from` fields of constructed 
     21they usually reside in :obj:`~Orange.feature.Descriptor.get_value_from` fields of constructed 
    2222features to facilitate their automatic computation. For instance, 
    2323the following script shows how to translate the :download:`monks-1.tab <code/monks-1.tab>` data set 
     
    302302    ['1', '3', '2', '0'] <12.000, 0.000> 
    303303 
    304 ClassifierByDataTable will usually be used by :obj:`Orange.data.variable.Variable.get_value_from`. So, we 
     304ClassifierByDataTable will usually be used by :obj:`Orange.feature.Descriptor.get_value_from`. So, we 
    305305would probably continue this by constructing a new feature and put the 
    306 classifier into its :obj:`Orange.data.variable.Variable.get_value_from`. 
    307  
    308     >>> y2 = Orange.data.variable.Discrete("y2", values = ["0", "1"]) 
     306classifier into its :obj:`Orange.feature.Descriptor.get_value_from`. 
     307 
     308    >>> y2 = Orange.feature.Discrete("y2", values = ["0", "1"]) 
    309309    >>> y2.get_value_from = abe 
    310310 
     
    321321the new class variable and the features that should be used for 
    322322classification. This saves us from constructing data_s and reassigning 
    323 the class_var. It doesn't set the :obj:`Orange.data.variable.Variable.get_value_from`, though. 
     323the class_var. It doesn't set the :obj:`Orange.feature.Descriptor.get_value_from`, though. 
    324324 
    325325part of :download:`lookup-table.py <code/lookup-table.py>` (uses: :download:`monks-1.tab <code/monks-1.tab>`):: 
     
    330330    a, b, e = table.domain["a"], table.domain["b"], table.domain["e"] 
    331331 
    332     y2 = Orange.data.variable.Discrete("y2", values = ["0", "1"]) 
     332    y2 = Orange.feature.Discrete("y2", values = ["0", "1"]) 
    333333    abe2 = Orange.classification.lookup.LookupLearner(y2, [a, b, e], table) 
    334334 
     
    380380    as follows. 
    381381     
    382         >>> newvar = Orange.data.variable.Discrete() 
     382        >>> newvar = Orange.feature.Discrete() 
    383383        >>> bound = [table.domain[name] for name in ["a", "b"]] 
    384384        >>> lookup = lookup_from_bound(newvar, bound) 
     
    407407     
    408408        >>> bound = [table.domain[name] for name in ["a", "b"]] 
    409         >>> newVar = Orange.data.variable.Discrete("a=b", values=["no", "yes"]) 
     409        >>> newVar = Orange.feature.Discrete("a=b", values=["no", "yes"]) 
    410410        >>> lookup = lookup_from_function(newVar, bound, lambda x: x[0] == x[1]) 
    411411        >>> newVar.get_value_from = lookup 
     
    429429    (either when needed by addAnAttribute or at some other place), lookup 
    430430    should be used to compute newVar's value. (A bit off topic, but 
    431     important: you should never call :obj:`Orange.data.variable.Variable.get_value_from` directly, but always call 
     431    important: you should never call :obj:`Orange.feature.Descriptor.get_value_from` directly, but always call 
    432432    it through computeValue.) 
    433433 
     
    450450    dump_lookup_function returns a string with a lookup function in 
    451451    tab-delimited format. Argument func can be any of the above-mentioned 
    452     classifiers or a feature whose :obj:`Orange.data.variable.Variable.get_value_from` points to one of such 
     452    classifiers or a feature whose :obj:`Orange.feature.Descriptor.get_value_from` points to one of such 
    453453    classifiers. 
    454454 
     
    536536         
    537537def dump_lookup_function(func): 
    538     if isinstance(func, Orange.data.variable.Variable): 
     538    if isinstance(func, Orange.feature.Descriptor): 
    539539        if not func.get_value_from: 
    540540            raise TypeError, "attribute '%s' does not have an associated function" % func.name 
  • Orange/classification/rules.py

    r9857 r9936  
    627627def create_dichotomous_class(domain, att, value, negate, removeAtt=None): 
    628628    # create new variable 
    629     newClass = Orange.data.variable.Discrete(att.name + "_", values=[str(value) + "_", "not " + str(value)]) 
     629    newClass = Orange.feature.Discrete(att.name + "_", values=[str(value) + "_", "not " + str(value)]) 
    630630    positive = Orange.data.Value(newClass, str(value) + "_") 
    631631    negative = Orange.data.Value(newClass, "not " + str(value)) 
     
    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.) 
    1735             instances.domain.addmeta(weights, Orange.data.variable.\ 
     1735            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.) 
    1739         instances.domain.addmeta(newWeightsID, Orange.data.variable.\ 
     1739        instances.domain.addmeta(newWeightsID, Orange.feature.\ 
    17401740            Continuous("weights-" + str(newWeightsID)), True) 
    17411741        for instance in instances: 
     
    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.) 
    1760             instances.domain.addmeta(weights, Orange.data.variable.\ 
     1760            instances.domain.addmeta(weights, Orange.feature.\ 
    17611761                Continuous("weights-" + str(weights)), True) 
    17621762        try: 
    17631763            coverage = instances.domain.getmeta("Coverage") 
    17641764        except: 
    1765             coverage = Orange.data.variable.Continuous("Coverage") 
    1766             instances.domain.addmeta(Orange.data.new_meta_id(), coverage, True) 
     1765            coverage = Orange.feature.Continuous("Coverage") 
     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.) 
    1770         instances.domain.addmeta(newWeightsID, Orange.data.variable.\ 
     1770        instances.domain.addmeta(newWeightsID, Orange.feature.\ 
    17711771            Continuous("weights-" + str(newWeightsID)), True) 
    17721772        for instance in instances: 
     
    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) 
    17921792        examples.domain.addmeta(self.prob_attribute, 
    1793             Orange.data.variable.Continuous("Probs")) 
     1793            Orange.feature.Continuous("Probs")) 
    17941794        self.argument_id = argument_id 
    17951795 
  • Orange/classification/svm/__init__.py

    r9671 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 
     
    294294        # Fix the svm_type parameter if we have a class_var/svm_type mismatch 
    295295        if self.svm_type in [0,1] and \ 
    296             isinstance(class_var, Orange.data.variable.Continuous): 
     296            isinstance(class_var, Orange.feature.Continuous): 
    297297            self.svm_type += 3 
    298298            #raise AttributeError, "Cannot learn a discrete classifier from non descrete class data. Use EPSILON_SVR or NU_SVR for regression" 
    299299        if self.svm_type in [3,4] and \ 
    300             isinstance(class_var, Orange.data.variable.Discrete): 
     300            isinstance(class_var, Orange.feature.Discrete): 
    301301            self.svm_type -= 3 
    302302            #raise AttributeError, "Cannot do regression on descrete class data. Use C_SVC or NU_SVC for classification" 
     
    647647            for sv_ind in range(*sv_ranges[i]): 
    648648                attributes = SVs.domain.attributes + \ 
    649                 SVs[sv_ind].getmetas(False, Orange.data.variable.Variable).keys() 
     649                SVs[sv_ind].getmetas(False, Orange.feature.Descriptor).keys() 
    650650                for attr in attributes: 
    651                     if attr.varType == Orange.data.Type.Continuous: 
     651                    if attr.varType == Orange.feature.Type.Continuous: 
    652652                        update_weights(w, attr, to_float(SVs[sv_ind][attr]), \ 
    653653                                       classifier.coef[coef_ind][sv_ind]) 
     
    655655            for sv_ind in range(*sv_ranges[j]): 
    656656                attributes = SVs.domain.attributes + \ 
    657                 SVs[sv_ind].getmetas(False, Orange.data.variable.Variable).keys() 
     657                SVs[sv_ind].getmetas(False, Orange.feature.Descriptor).keys() 
    658658                for attr in attributes: 
    659                     if attr.varType==Orange.data.Type.Continuous: 
     659                    if attr.varType==Orange.feature.Type.Continuous: 
    660660                        update_weights(w, attr, to_float(SVs[sv_ind][attr]), \ 
    661661                                       classifier.coef[coef_ind][sv_ind]) 
     
    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): 
     
    826826    attrs = data.domain.attributes + data.domain.getmetas().values() 
    827827    attrs = [attr for attr in attrs if attr.varType  
    828              in [Orange.data.Type.Continuous,  
    829                  Orange.data.Type.Discrete]] 
     828             in [Orange.feature.Type.Continuous,  
     829                 Orange.feature.Type.Discrete]] 
    830830    cv = data.domain.classVar 
    831831     
    832832    for ex in data: 
    833         if cv.varType == Orange.data.Type.Discrete: 
     833        if cv.varType == Orange.feature.Type.Discrete: 
    834834            file.write(str(int(ex[cv])))   
    835835        else: 
  • Orange/classification/tree.py

    r9671 r9923  
    10161016a regression tree does not always predict the leaf average, but whatever 
    10171017the :obj:`~Node.node_classifier` in a leaf returns.  As ``%V`` uses the 
    1018 :obj:`Orange.data.variable.Continuous`' function for printing the 
     1018:obj:`Orange.feature.Continuous`' function for printing the 
    10191019value, the number has the same number of decimals as in the data file. 
    10201020 
     
    18491849        if not self._handset_split and not self.measure: 
    18501850            measure = fscoring.GainRatio() \ 
    1851                 if instances.domain.class_var.var_type == Orange.data.Type.Discrete \ 
     1851                if instances.domain.class_var.var_type == Orange.feature.Type.Discrete \ 
    18521852                else fscoring.MSE() 
    18531853            bl.split.continuous_split_constructor.measure = measure 
     
    21262126 
    21272127def replaceCdisc(strg, mo, node, parent, tree): 
    2128     if tree.class_var.var_type != Orange.data.Type.Discrete: 
     2128    if tree.class_var.var_type != Orange.feature.Type.Discrete: 
    21292129        return insert_dot(strg, mo) 
    21302130 
     
    21442144 
    21452145def replacecdisc(strg, mo, node, parent, tree): 
    2146     if tree.class_var.var_type != Orange.data.Type.Discrete: 
     2146    if tree.class_var.var_type != Orange.feature.Type.Discrete: 
    21472147        return insert_dot(strg, mo) 
    21482148 
     
    21662166 
    21672167def replaceCcont(strg, mo, node, parent, tree): 
    2168     if tree.class_var.var_type != Orange.data.Type.Continuous: 
     2168    if tree.class_var.var_type != Orange.feature.Type.Continuous: 
    21692169        return insert_dot(strg, mo) 
    21702170 
     
    21862186 
    21872187def replaceccont(strg, mo, node, parent, tree): 
    2188     if tree.class_var.var_type != Orange.data.Type.Continuous: 
     2188    if tree.class_var.var_type != Orange.feature.Type.Continuous: 
    21892189        return insert_dot(strg, mo) 
    21902190 
     
    22202220 
    22212221def replaceCconti(strg, mo, node, parent, tree): 
    2222     if tree.class_var.var_type != Orange.data.Type.Continuous: 
     2222    if tree.class_var.var_type != Orange.feature.Type.Continuous: 
    22232223        return insert_dot(strg, mo) 
    22242224 
     
    22382238 
    22392239def replacecconti(strg, mo, node, parent, tree): 
    2240     if tree.class_var.var_type != Orange.data.Type.Continuous: 
     2240    if tree.class_var.var_type != Orange.feature.Type.Continuous: 
    22412241        return insert_dot(strg, mo) 
    22422242 
     
    22602260 
    22612261def replaceD(strg, mo, node, parent, tree): 
    2262     if tree.class_var.var_type != Orange.data.Type.Discrete: 
     2262    if tree.class_var.var_type != Orange.feature.Type.Discrete: 
    22632263        return insert_dot(strg, mo) 
    22642264 
     
    22792279 
    22802280def replaced(strg, mo, node, parent, tree): 
    2281     if tree.class_var.var_type != Orange.data.Type.Discrete: 
     2281    if tree.class_var.var_type != Orange.feature.Type.Discrete: 
    22822282        return insert_dot(strg, mo) 
    22832283 
     
    23012301 
    23022302def replaceAE(strg, mo, node, parent, tree): 
    2303     if tree.class_var.var_type != Orange.data.Type.Continuous: 
     2303    if tree.class_var.var_type != Orange.feature.Type.Continuous: 
    23042304        return insert_dot(strg, mo) 
    23052305 
     
    23302330 
    23312331def replaceI(strg, mo, node, parent, tree): 
    2332     if tree.class_var.var_type != Orange.data.Type.Continuous: 
     2332    if tree.class_var.var_type != Orange.feature.Type.Continuous: 
    23332333        return insert_dot(strg, mo) 
    23342334 
     
    23732373        else: 
    23742374            if self.node().node_classifier.class_var.var_type == \ 
    2375                     Orange.data.Type.Discrete: 
     2375                    Orange.feature.Type.Discrete: 
    23762376                self.leafStr = "%V (%^.2m%)" 
    23772377            else: 
     
    26572657    def to_network(self): 
    26582658        net = Orange.network.DiGraph() 
    2659         if self.class_var.var_type == Orange.data.Type.Discrete: 
     2659        if self.class_var.var_type == Orange.feature.Type.Discrete: 
    26602660            domain = Orange.data.Domain([self.class_var] + 
    2661                 [Orange.data.variable.Continuous(name) for name in 
     2661                [Orange.feature.Continuous(name) for name in 
    26622662                 ["instances", "majority proportion"] + list(self.class_var.values)], None) 
    26632663        else: 
    26642664            domain = Orange.data.Domain([self.class_var] + 
    2665                 [Orange.data.variable.Continuous(name) for name in 
     2665                [Orange.feature.Continuous(name) for name in 
    26662666                 ["error", "instances"]], None) 
    26672667        domain = Orange.data.Domain(domain) 
     
    26762676        d = node.distribution 
    26772677        maj = node.node_classifier.default_value 
    2678         if self.class_var.var_type == Orange.data.Type.Discrete: 
     2678        if self.class_var.var_type == Orange.feature.Type.Discrete: 
    26792679            if d.abs > 1e-6: 
    26802680                table.append([maj, d.abs, d[maj]] + [x / d.abs for x in d]) 
  • Orange/clustering/hierarchical.py

    r9752 r9906  
    8181         
    8282        :param matrix: A distance matrix to perform the clustering on. 
    83         :type matrix: :class:`Orange.core.SymMatrix` 
     83        :type matrix: :class:`Orange.misc.SymMatrix` 
    8484 
    8585 
     
    157157 
    158158Let us construct a simple distance matrix and run clustering on it. 
    159 :: 
    160  
    161     import Orange 
    162     from Orange.clustering import hierarchical 
    163     m = [[], 
    164          [ 3], 
    165          [ 2, 4], 
    166          [17, 5, 4], 
    167          [ 2, 8, 3, 8], 
    168          [ 7, 5, 10, 11, 2], 
    169          [ 8, 4, 1, 5, 11, 13], 
    170          [ 4, 7, 12, 8, 10, 1, 5], 
    171          [13, 9, 14, 15, 7, 8, 4, 6], 
    172          [12, 10, 11, 15, 2, 5, 7, 3, 1]] 
    173     matrix = Orange.core.SymMatrix(m) 
    174     root = hierarchical.HierarchicalClustering(matrix, 
    175             linkage=hierarchical.HierarchicalClustering.Average) 
     159 
     160.. literalinclude:: code/hierarchical-example.py 
     161    :lines: 1-14 
    176162     
    177163Root is a root of the cluster hierarchy. We can print using a 
    178164simple recursive function. 
    179 :: 
    180  
    181     def printClustering(cluster): 
    182         if cluster.branches: 
    183             return "(%s%s)" % (printClustering(cluster.left), printClustering(cluster.right)) 
    184         else: 
    185             return str(cluster[0]) 
     165 
     166.. literalinclude:: code/hierarchical-example.py 
     167    :lines: 16-20 
    186168             
    187169The output is not exactly nice, but it will have to do. Our clustering, 
     
    211193supposedly the only) element of cluster, cluster[0], we shall print 
    212194it out as a tuple.  
    213 :: 
    214  
    215     def printClustering2(cluster): 
    216         if cluster.branches: 
    217             return "(%s%s)" % (printClustering2(cluster.left), printClustering2(cluster.right)) 
    218         else: 
    219             return str(tuple(cluster)) 
     195 
     196.. literalinclude:: code/hierarchical-example.py 
     197    :lines: 22-26 
    220198             
    221199The distance matrix could have been given a list of objects. We could, 
    222200for instance, put 
    223 :: 
    224      
    225     matrix.objects = ["Ann", "Bob", "Curt", "Danny", "Eve", 
    226                       "Fred", "Greg", "Hue", "Ivy", "Jon"] 
     201     
     202.. literalinclude:: code/hierarchical-example.py 
     203    :lines: 28-29 
    227204 
    228205above calling the HierarchicalClustering. 
     
    234211If we've forgotten to store the objects into matrix prior to clustering, 
    235212nothing is lost. We can add it into clustering later, by 
    236 :: 
    237  
    238     root.mapping.objects = ["Ann", "Bob", "Curt", "Danny", "Eve", "Fred", "Greg", "Hue", "Ivy", "Jon"] 
     213 
     214.. literalinclude:: code/hierarchical-example.py 
     215    :lines: 31 
    239216     
    240217So, what do these "objects" do? Call printClustering(root) again and you'll 
     
    269246of ``root.left`` and ``root.right``. 
    270247 
    271 Let us write function for cluster pruning. :: 
    272  
    273     def prune(cluster, togo): 
    274         if cluster.branches: 
    275             if togo<0: 
    276                 cluster.branches = None 
    277             else: 
    278                 for branch in cluster.branches: 
    279                     prune(branch, togo-cluster.height) 
     248Let us write function for cluster pruning. 
     249 
     250.. literalinclude:: code/hierarchical-example.py 
     251    :lines: 33-39 
    280252 
    281253We shall use ``printClustering2`` here, since we can have multiple elements 
     
    287259     
    288260We've ended up with four clusters. Need a list of clusters? 
    289 Here's the function. :: 
    290      
    291     def listOfClusters0(cluster, alist): 
    292         if not cluster.branches: 
    293             alist.append(list(cluster)) 
    294         else: 
    295             for branch in cluster.branches: 
    296                 listOfClusters0(branch, alist) 
    297                  
    298     def listOfClusters(root): 
    299         l = [] 
    300         listOfClusters0(root, l) 
    301         return l 
     261Here's the function. 
     262 
     263.. literalinclude:: code/hierarchical-example.py 
     264    :lines: 41-51 
    302265         
    303266The function returns a list of lists, in our case 
     
    313276and cluster it with average linkage. Since we don't need the matrix, 
    314277we shall let the clustering overwrite it (not that it's needed for 
    315 such a small data set as Iris). :: 
    316  
    317     import Orange 
    318     from Orange.clustering import hierarchical 
    319  
    320     data = Orange.data.Table("iris") 
    321     matrix = Orange.core.SymMatrix(len(data)) 
    322     matrix.setattr("objects", data) 
    323     distance = Orange.distance.Euclidean(data) 
    324     for i1, instance1 in enumerate(data): 
    325         for i2 in range(i1+1, len(data)): 
    326             matrix[i1, i2] = distance(instance1, data[i2]) 
    327              
    328     clustering = hierarchical.HierarchicalClustering() 
    329     clustering.linkage = clustering.Average 
    330     clustering.overwrite_matrix = 1 
    331     root = clustering(matrix) 
     278such a small data set as Iris). 
     279 
     280.. literalinclude:: code/hierarchical-example-2.py 
     281    :lines: 1-15 
    332282 
    333283Note that we haven't forgotten to set the ``matrix.objects``. We did it 
    334284through ``matrix.setattr`` to avoid the warning. Let us now prune the 
    335285clustering using the function we've written above, and print out the 
    336 clusters. :: 
    337      
    338     prune(root, 1.4) 
    339     for n, cluster in enumerate(listOfClusters(root)): 
    340         print "\n\n Cluster %i \n" % n 
    341         for instance in cluster: 
    342             print instance 
     286clusters. 
     287     
     288.. literalinclude:: code/hierarchical-example-2.py 
     289    :lines: 16-20 
    343290             
    344291Since the printout is pretty long, it might be more informative to just 
    345 print out the class distributions for each cluster. :: 
    346      
    347     for cluster in listOfClusters(root): 
    348         dist = Orange.core.get_class_distribution(cluster) 
    349         for e, d in enumerate(dist): 
    350             print "%s: %3.0f " % (data.domain.class_var.values[e], d), 
    351         print 
     292print out the class distributions for each cluster. 
     293     
     294.. literalinclude:: code/hierarchical-example-2.py 
     295    :lines: 22-26 
    352296         
    353297Here's what it shows. :: 
     
    365309instance, call a learning algorithms, passing a cluster as an argument. 
    366310It won't mind. If you, however, want to have a list of table, you can 
    367 easily convert the list by :: 
    368  
    369     tables = [Orange.data.Table(cluster) for cluster in listOfClusters(root)] 
     311easily convert the list by 
     312 
     313.. literalinclude:: code/hierarchical-example-2.py 
     314    :lines: 28 
    370315     
    371316Finally, if you are dealing with examples, you may want to take the function 
     
    502447    """ 
    503448    distance = distance_constructor(data) 
    504     matrix = orange.SymMatrix(len(data)) 
     449    matrix = Orange.misc.SymMatrix(len(data)) 
    505450    for i in range(len(data)): 
    506451        for j in range(i+1): 
     
    540485     
    541486    """ 
    542     matrix = orange.SymMatrix(len(data.domain.attributes)) 
     487    matrix = Orange.misc.SymMatrix(len(data.domain.attributes)) 
    543488    for a1 in range(len(data.domain.attributes)): 
    544489        for a2 in range(a1): 
     
    618563    :type tree: :class:`HierarchicalCluster` 
    619564    :param matrix: SymMatrix that was used to compute the clustering. 
    620     :type matrix: :class:`Orange.core.SymMatrix` 
     565    :type matrix: :class:`Orange.misc.SymMatrix` 
    621566    :param progress_callback: Function used to report on progress. 
    622567    :type progress_callback: function 
     
    811756    :type tree: :class:`HierarchicalCluster` 
    812757    :param matrix: SymMatrix that was used to compute the clustering. 
    813     :type matrix: :class:`Orange.core.SymMatrix` 
     758    :type matrix: :class:`Orange.misc.SymMatrix` 
    814759    :param progress_callback: Function used to report on progress. 
    815760    :type progress_callback: function 
     
    15111456 
    15121457def feature_distance_matrix(data, distance=None, progress_callback=None): 
    1513     """ A helper function that computes an :class:`Orange.core.SymMatrix` of 
     1458    """ A helper function that computes an :class:`Orange.misc.SymMatrix` of 
    15141459    all pairwise distances between features in `data`. 
    15151460     
     
    15241469    :type progress_callback: function 
    15251470     
    1526     :rtype: :class:`Orange.core.SymMatrix` 
     1471    :rtype: :class:`Orange.misc.SymMatrix` 
    15271472     
    15281473    """ 
    15291474    attributes = data.domain.attributes 
    1530     matrix = orange.SymMatrix(len(attributes)) 
     1475    matrix = Orange.misc.SymMatrix(len(attributes)) 
    15311476    iter_count = matrix.dim * (matrix.dim - 1) / 2 
    15321477    milestones = progress_bar_milestones(iter_count, 100) 
     
    15811526    :type cluster: :class:`HierarchicalCluster` 
    15821527     
    1583     :rtype: :class:`Orange.core.SymMatrix` 
     1528    :rtype: :class:`Orange.misc.SymMatrix` 
    15841529     
    15851530    """ 
    15861531 
    15871532    mapping = cluster.mapping   
    1588     matrix = Orange.core.SymMatrix(len(mapping)) 
     1533    matrix = Orange.misc.SymMatrix(len(mapping)) 
    15891534    for cluster in postorder(cluster): 
    15901535        if cluster.branches: 
     
    16241569     
    16251570     
    1626 if __name__=="__main__": 
    1627     data = orange.ExampleTable("doc//datasets//brown-selected.tab") 
    1628 #    data = orange.ExampleTable("doc//datasets//iris.tab") 
    1629     root = hierarchicalClustering(data, order=True) #, linkage=orange.HierarchicalClustering.Single) 
    1630     attr_root = hierarchicalClustering_attributes(data, order=True) 
    1631 #    print root 
    1632 #    d = DendrogramPlotPylab(root, data=data, labels=[str(ex.getclass()) for ex in data], dendrogram_width=0.4, heatmap_width=0.3,  params={}, cmap=None) 
    1633 #    d.plot(show=True, filename="graph.png") 
    1634  
    1635     dendrogram_draw("graph.eps", root, attr_tree=attr_root, data=data, labels=[str(e.getclass()) for e in data], tree_height=50, #width=500, height=500, 
    1636                           cluster_colors={root.right:(255,0,0), root.right.right:(0,255,0)},  
    1637                           color_palette=ColorPalette([(255, 0, 0), (0,0,0), (0, 255,0)], gamma=0.5,  
    1638                                                      overflow=(255, 255, 255), underflow=(255, 255, 255))) #, minv=-0.5, maxv=0.5) 
  • Orange/clustering/mixture.py

    r9671 r9919  
    321321        self.domain = domain 
    322322        self.norm_model = norm_model 
    323         self.cluster_vars = [Orange.data.variable.Continuous("cluster %i" % i)\ 
     323        self.cluster_vars = [Orange.feature.Continuous("cluster %i" % i)\ 
    324324                             for i in range(len(norm_model))] 
    325325        self.weights = self.norm_model.weights 
  • 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

    r9799 r9936  
    6666The signature for the custom load functions should be 
    6767 
    68 ``load_myformat(filename, create_new_on=Variable.MakeStatus.NoRecognizedValues, **kwargs)`` 
    69      
    70 When constructing variables :obj:`Orange.data.variable.make` should  
     68``load_myformat(filename, create_new_on=Orange.feature.Descriptor.MakeStatus.NoRecognizedValues, **kwargs)`` 
     69     
     70When constructing variables :obj:`Orange.feature.Descriptor.make` should  
    7171be used with the ``create_new_on`` parameter.  
    72 :obj:`~Orange.data.variable.make` will return an attribute and the  
     72:obj:`~Orange.feature.Descriptor.make` will return an attribute and the  
    7373status of the variable, telling whether a new attribute was created  
    74 or the old one reused and why (see :mod:`Orange.data.variable`).  
     74or the old one reused and why (see :mod:`Orange.feature`).  
    7575Additional keyword arguments can be provided in the call to  
    7676:obj:`~Orange.data.Table` constructor. These will be passed in the  
     
    9090 
    9191import Orange 
    92 import Orange.data.variable 
     92import Orange.feature 
    9393import Orange.misc 
    9494from Orange.core import \ 
     
    9898 
    9999from Orange.data import variable 
    100 from Orange.data.variable import Variable 
    101 MakeStatus = Variable.MakeStatus 
     100from Orange.feature import Descriptor 
     101MakeStatus = Orange.feature.Descriptor.MakeStatus 
     102make = Orange.feature.Descriptor.make 
    102103 
    103104def loadARFF(filename, create_on_new=MakeStatus.Incompatible, **kwargs): 
     
    115116        return loadARFF_Weka(filename, create_on_new) 
    116117 
    117 def loadARFF_Weka(filename, create_on_new=Orange.data.variable.Variable.MakeStatus.Incompatible, **kwargs): 
     118def loadARFF_Weka(filename, create_on_new=MakeStatus.Incompatible, **kwargs): 
    118119    """Return class:`Orange.data.Table` containing data from file in Weka ARFF format""" 
    119120    if not os.path.exists(filename) and os.path.exists(filename + ".arff"): 
     
    190191                        if len(sy) > 0: 
    191192                            vals.append(sy) 
    192                     a, s = Variable.make(atn, Orange.data.Type.Discrete, vals, [], create_on_new) 
     193                    a, s = make(atn, Orange.feature.Type.Discrete, vals, [], create_on_new) 
    193194                else: 
    194195                    # real... 
    195                     a, s = Variable.make(atn, Orange.data.Type.Continuous, [], [], create_on_new) 
     196                    a, s = make(atn, Orange.feature.Type.Continuous, [], [], create_on_new) 
    196197 
    197198                attributes.append(a) 
     
    270271        f.write('%s\n' % x[-1]) 
    271272 
    272 def loadMULAN(filename, create_on_new=Orange.data.variable.Variable.MakeStatus.Incompatible, **kwargs): 
     273def loadMULAN(filename, create_on_new=MakeStatus.Incompatible, **kwargs): 
    273274    """Return class:`Orange.data.Table` containing data from file in Mulan ARFF and XML format""" 
    274275    if filename[-4:] == ".xml": 
     
    398399    attributeLoadStatus = {} 
    399400    def make_float(name): 
    400         attr, s = Orange.data.variable.make(name, Orange.data.Type.Continuous, [], [], create_on_new) 
     401        attr, s = Orange.feature.Descriptor.make(name, Orange.feature.Type.Continuous, [], [], create_on_new) 
    401402        attributeLoadStatus[attr] = s 
    402403        return attr 
    403404 
    404405    def make_disc(name, unordered): 
    405         attr, s = Orange.data.variable.make(name, Orange.data.Type.Discrete, [], unordered, create_on_new) 
     406        attr, s = Orange.feature.Descriptor.make(name, Orange.feature.Type.Discrete, [], unordered, create_on_new) 
    406407        attributeLoadStatus[attr] = s 
    407408        return attr 
     
    478479        return variable.Python 
    479480    elif cell == "": 
    480         return variable.Variable 
     481        return variable.Descriptor 
    481482    elif len(cell.split(",")) > 1: 
    482483        return variable.Discrete, cell.split(",") 
     
    632633            undefined_vars.append((i, variables[-1])) 
    633634        elif var_t == variable.Continuous: 
    634             variables.append(variable.make(name, Orange.data.Type.Continuous, [], [], create_new_on)) 
     635            variables.append(variable.make(name, Orange.feature.Type.Continuous, [], [], create_new_on)) 
    635636        elif var_t == variable.String: 
    636             variables.append(variable.make(name, Orange.data.Type.String, [], [], create_new_on)) 
     637            variables.append(variable.make(name, Orange.feature.Type.String, [], [], create_new_on)) 
    637638        elif var_t == variable.Python: 
    638639            variables.append(variable.Python(name)) 
     
    640641            var_t, values = var_t 
    641642            if var_t == variable.Discrete: 
    642                 variables.append(variable.make(name, Orange.data.Type.Discrete, values, [], create_new_on)) 
     643                variables.append(variable.make(name, Orange.feature.Type.Discrete, values, [], create_new_on)) 
    643644            elif var_t == variable.Python: 
    644645                raise NotImplementedError() 
     
    657658        values = sorted(values) 
    658659        if isinstance(var_def, _disc_placeholder): 
    659             variables[ind] = variable.make(var_def.name, Orange.data.Type.Discrete, [], values, create_new_on) 
     660            variables[ind] = variable.make(var_def.name, Orange.feature.Type.Discrete, [], values, create_new_on) 
    660661        elif isinstance(var_def, _var_placeholder): 
    661662            if is_variable_cont(values): 
    662                 variables[ind] = variable.make(var_def.name, Orange.data.Type.Continuous, [], [], create_new_on) 
     663                variables[ind] = variable.make(var_def.name, Orange.feature.Type.Continuous, [], [], create_new_on) 
    663664            elif is_variable_discrete(values): 
    664                 variables[ind] = variable.make(var_def.name, Orange.data.Type.Discrete, [], values, create_new_on) 
     665                variables[ind] = variable.make(var_def.name, Orange.feature.Type.Discrete, [], values, create_new_on) 
    665666            elif is_variable_string(values): 
    666                 variables[ind] = variable.make(var_def.name, Orange.data.Type.String, [], [], create_new_on) 
     667                variables[ind] = variable.make(var_def.name, Orange.feature.Type.String, [], [], create_new_on) 
    667668            else: 
    668669                raise ValueError("Strange column in the data") 
     
    692693                class_indices.append(i) 
    693694            elif flag == "meta": 
    694                 mid = Orange.data.new_meta_id() 
     695                mid = Orange.feature.Descriptor.new_meta_id() 
    695696                metas[mid] = var 
    696697                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/distance/__init__.py

    r9805 r9923  
    3838    def __call__(self, table): 
    3939        indxs = [i for i, a in enumerate(table.domain.attributes) \ 
    40                  if a.varType==Orange.data.Type.Continuous] 
     40                 if a.varType==Orange.feature.Type.Continuous] 
    4141        return PearsonRDistance(domain=table.domain, indxs=indxs) 
    4242 
     
    8484    def __call__(self, table): 
    8585        indxs = [i for i, a in enumerate(table.domain.attributes) \ 
    86                  if a.varType==Orange.data.Type.Continuous] 
     86                 if a.varType==Orange.feature.Type.Continuous] 
    8787        return SpearmanRDistance(domain=table.domain, indxs=indxs) 
    8888 
     
    176176    def __call__(self, data): 
    177177        indxs = [i for i, a in enumerate(data.domain.attributes) \ 
    178                  if a.varType==Orange.data.Type.Continuous] 
     178                 if a.varType==Orange.feature.Type.Continuous] 
    179179        return PearsonRAbsoluteDistance(domain=data.domain, indxs=indxs) 
    180180     
     
    211211    def __call__(self, data): 
    212212        indxs = [i for i, a in enumerate(data.domain.attributes) \ 
    213                  if a.varType==Orange.data.Type.Continuous] 
     213                 if a.varType==Orange.feature.Type.Continuous] 
    214214        return SpearmanRAbsoluteDistance(domain=data.domain, indxs=indxs) 
    215215     
     
    247247    
    248248def distance_matrix(data, distance_constructor=Euclidean, progress_callback=None): 
    249     """ A helper function that computes an :obj:`Orange.data.SymMatrix` of all 
     249    """ A helper function that computes an :obj:`Orange.misc.SymMatrix` of all 
    250250    pairwise distances between instances in `data`. 
    251251     
     
    260260    :type progress_callback: function 
    261261     
    262     :rtype: :class:`Orange.data.SymMatrix` 
    263      
    264     """ 
    265     matrix = Orange.data.SymMatrix(len(data)) 
     262    :rtype: :class:`Orange.misc.SymMatrix` 
     263     
     264    """ 
     265    matrix = Orange.misc.SymMatrix(len(data)) 
    266266    dist = distance_constructor(data) 
    267267 
  • Orange/ensemble/bagging.py

    r9733 r9923  
    8686     
    8787    :param class_var: the class feature. 
    88     :type class_var: :class:`Orange.data.variable.Variable` 
     88    :type class_var: :class:`Orange.feature.Descriptor` 
    8989 
    9090    """ 
     
    108108              :class:`Orange.statistics.Distribution` or a tuple with both 
    109109        """ 
    110         if self.class_var.var_type == Orange.data.Type.Discrete: 
     110        if self.class_var.var_type == Orange.feature.Type.Discrete: 
    111111            freq = [0.] * len(self.class_var.values) 
    112112            for c in self.classifiers: 
     
    126126                return value 
    127127             
    128         elif self.class_var.var_type ==Orange.data.Type.Continuous: 
     128        elif self.class_var.var_type ==Orange.feature.Type.Continuous: 
    129129            votes = [c(instance, orange.GetBoth if result_type==\ 
    130130                orange.GetProbabilities else result_type) \ 
  • Orange/ensemble/boosting.py

    r9733 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: 
     
    110110     
    111111    :param class_var: the class feature. 
    112     :type class_var: :class:`Orange.data.variable.Variable` 
     112    :type class_var: :class:`Orange.feature.Descriptor` 
    113113     
    114114    """ 
  • Orange/ensemble/forest.py

    r9733 r9919  
    194194     
    195195    :param class_var: the class feature. 
    196     :type class_var: :class:`Orange.data.variable.Variable` 
     196    :type class_var: :class:`Orange.feature.Descriptor` 
    197197 
    198198    """ 
     
    220220        # handle discreete class 
    221221         
    222         if self.class_var.var_type == Orange.data.variable.Discrete.Discrete: 
     222        if self.class_var.var_type == Orange.feature.Discrete.Discrete: 
    223223         
    224224            # voting for class probabilities 
     
    336336         
    337337        :param feature: feature to evaluate (by index, name or 
    338             :class:`Orange.data.variable.Variable` object). 
    339         :type feature: int, str or :class:`Orange.data.variable.Variable`. 
     338            :class:`Orange.feature.Descriptor` object). 
     339        :type feature: int, str or :class:`Orange.feature.Descriptor`. 
    340340         
    341341        :param instances: data instances to use for importance evaluation. 
     
    352352          attrName = feature 
    353353          attrNo = instances.domain.index(attrName) 
    354         elif isinstance(feature, Orange.data.variable.Variable): 
     354        elif isinstance(feature, Orange.feature.Descriptor): 
    355355          atrs = [a for a in instances.domain.attributes] 
    356356          attrNo = atrs.index(feature) 
     
    512512        if not bcopy.measure: 
    513513            bcopy.measure = Orange.feature.scoring.Gini() \ 
    514                 if isinstance(instances.domain.class_var, Orange.data.variable.Discrete) \ 
     514                if isinstance(instances.domain.class_var, Orange.feature.Discrete) \ 
    515515                else Orange.feature.scoring.MSE() 
    516516 
  • Orange/evaluation/reliability.py

    r9816 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) 
     
    698698        new_domain = None 
    699699         
    700         if instances.domain.class_var.var_type != Orange.data.variable.Continuous.Continuous: 
     700        if instances.domain.class_var.var_type != Orange.feature.Continuous.Continuous: 
    701701            raise Exception("This method only works on data with continuous class.") 
    702702         
  • Orange/evaluation/testing.py

    r9697 r9923  
    3838        """Appends a new result (class and probability prediction by a single classifier) to the classes and probabilities field.""" 
    3939     
    40         if type(aclass)==list: 
    41             self.classes.append(aclass) 
    42             self.probabilities.append(aprob) 
     40        if type(aclass)==int: 
     41            self.classes.append(int(aclass)) 
     42            self.probabilities.append(list(aprob)) 
    4343        elif type(aclass.value)==float: 
    4444            self.classes.append(float(aclass)) 
    4545            self.probabilities.append(aprob) 
    4646        else: 
    47             self.classes.append(int(aclass)) 
    48             self.probabilities.append(list(aprob)) 
     47            self.classes.append(aclass) 
     48            self.probabilities.append(aprob) 
    4949 
    5050    def set_result(self, i, aclass, aprob): 
     
    109109            self.base_class = self.class_values = None 
    110110            if test_type==TEST_TYPE_SINGLE: 
    111                 if domain.class_var.var_type == Orange.data.Type.Discrete: 
     111                if domain.class_var.var_type == Orange.feature.Type.Discrete: 
    112112                    self.class_values = list(domain.class_var.values) 
    113113                    self.base_class = domain.class_var.base_value 
     
    117117            elif test_type==TEST_TYPE_MLC: 
    118118                self.labels = [var.name for var in domain.class_vars] 
    119                 self.converter = lambda vals: [int(val) if val.variable.var_type == Orange.data.Type.Discrete 
     119                self.converter = lambda vals: [int(val) if val.variable.var_type == Orange.feature.Type.Discrete 
    120120                                               else float(val) for val in vals] 
    121121 
  • Orange/feature/__init__.py

    r9895 r9936  
    1616from Orange.core import StringVariable as String 
    1717 
    18 from Orange.core import VarList as Descriptors 
    19  
    20 from Orange.core import newmetaid as new_meta_id 
    21  
    22 from Orange.core import Variable as V 
    23 make = V.make 
    24 retrieve = V.get_existing 
    25 MakeStatus = V.MakeStatus 
    26 del V 
     18from Orange.core import VarTypes as Type 
    2719 
    2820__docformat__ = 'restructuredtext' 
  • Orange/feature/discretization.py

    r9943 r9944  
    9393 
    9494        from Orange.feature import discretization 
    95         bayes = Orange.classification.bayes.NaiveBayesLearner() 
     95        bayes = Orange.classification.bayes.Learner() 
    9696        disc = orange.Preprocessor_discretize(method=discretization.EquiNDiscretization(numberOfIntervals=10)) 
    9797        dBayes = discretization.DiscretizedLearner(bayes, name='disc bayes') 
  • Orange/feature/scoring.py

    r9813 r9919  
    9191    :param attribute: the chosen feature, either as a descriptor,  
    9292      index, or a name. 
    93     :type attribute: :class:`Orange.data.variable.Variable` or int or string 
     93    :type attribute: :class:`Orange.feature.Descriptor` or int or string 
    9494    :param data: data. 
    9595    :type data: `Orange.data.Table` 
     
    102102    :param attribute: the chosen feature, either as a descriptor,  
    103103      index, or a name. 
    104     :type attribute: :class:`Orange.data.variable.Variable` or int or string 
     104    :type attribute: :class:`Orange.feature.Descriptor` or int or string 
    105105    :param domain_contingency:  
    106106    :type domain_contingency: :obj:`Orange.statistics.contingency.Domain` 
     
    469469 
    470470        :param weight: meta attribute that stores weights of instances 
    471         :type weight: Orange.data.variable.Variable 
     471        :type weight: Orange.feature.Descriptor 
    472472 
    473473        """ 
     
    508508 
    509509        :param attr: feature to score 
    510         :type attr: Orange.data.variable.Variable 
     510        :type attr: Orange.feature.Descriptor 
    511511 
    512512        :param data: a data table used to score features 
     
    517517         
    518518        :param weightID: meta feature used to weight individual data instances 
    519         :type weightID: Orange.data.variable.Variable 
     519        :type weightID: Orange.feature.Descriptor 
    520520 
    521521        """ 
     
    565565 
    566566        :param attr: feature to score 
    567         :type attr: Orange.data.variable.Variable 
     567        :type attr: Orange.feature.Descriptor 
    568568 
    569569        :param data: a data table used to score the feature 
     
    574574         
    575575        :param weightID: meta feature used to weight individual data instances 
    576         :type weightID: Orange.data.variable.Variable 
     576        :type weightID: Orange.feature.Descriptor 
    577577 
    578578        """ 
  • Orange/fixes/fix_changed_names.py

    r9860 r9942  
    3434           "orange.Domain": "Orange.data.Domain", 
    3535           "orange.Value": "Orange.data.Value", 
    36            "orange.VarTypes": "Orange.data.Type", 
    37            "orange.Variable": "Orange.data.variable.Variable", 
    38            "orange.EnumVariable": "Orange.data.variable.Discrete", 
    39            "orange.FloatVariable": "Orange.data.variable.Continuous", 
    40            "orange.StringVariable": "Orange.data.variable.String", 
    41            "orange.PythonVariable": "Orange.data.variable.Python", 
    42            "orange.VarList": "Orange.data.variable.Variables", 
    43            "orange.SymMatrix": "Orange.data.SymMatrix", 
     36           "orange.VarTypes": "Orange.feature.Type", 
     37           "orange.Variable": "Orange.feature.Descriptor", 
     38           "orange.EnumVariable": "Orange.feature.Discrete", 
     39           "orange.FloatVariable": "Orange.feature.Continuous", 
     40           "orange.StringVariable": "Orange.feature.String", 
     41           "orange.PythonVariable": "Orange.feature.Python", 
     42 
     43           "orange.newmetaid": "Orange.feature:Variable.new_meta_id", 
     44 
     45           "orange.SymMatrix": "Orange.misc.SymMatrix", 
     46 
    4447           "orange.GetValue": "Orange.classification:Classifier.GetValue", 
    4548           "orange.GetProbabilities": "Orange.classification:Classifier.GetProbabilities", 
    4649           "orange.GetBoth": "Orange.classification:Classifier.GetBoth", 
    47  
    48            "orange.newmetaid": "Orange.data.new_meta_id", 
    4950 
    5051           "orange.Distribution": "Orange.statistics.distribution.Distribution", 
  • Orange/misc/__init__.py

    r9891 r9938  
    2222 
    2323        Can be ``SymMatrix.Lower`` (0), ``SymMatrix.Upper`` (1),  
    24         ``SymMatrix.Symmetric`` (2, default), ``SymMatrix.Lower_Filled`` (3) or 
     24        ``SymMatrix.Symmetric`` (2, default), ``SymMatrix.LowerFilled`` (3) or 
    2525        ``SymMatrix.Upper_Filled`` (4).  
    2626 
    2727        If the matrix type is ``Lower`` or ``Upper``, indexing  
    2828        above or below the diagonal, respectively, will fail.  
    29         With ``Lower_Filled`` and ``Upper_Filled``, 
     29        With ``LowerFilled`` and ``Upper_Filled``, 
    3030        the elements upper or lower, respectively, still  
    3131        exist and are set to zero, but they cannot be modified. The  
     
    3535        If matrix type is ``Upper``, it is printed as: 
    3636 
     37        >>> import Orange 
     38        >>> m = Orange.misc.SymMatrix( 
     39        ...     [[1],  
     40        ...      [2, 4],  
     41        ...      [3, 6, 9],  
     42        ...      [4, 8, 12, 16]]) 
    3743        >>> m.matrix_type = m.Upper 
    3844        >>> print m 
     
    4248         (                        16.000)) 
    4349 
    44         Changing the type to ``Lower_Filled`` changes the printout to 
    45  
    46         >>> m.matrix_type = m.Lower_Filled 
     50        Changing the type to ``LowerFilled`` changes the printout to 
     51 
     52        >>> m.matrix_type = m.LowerFilled 
    4753        >>> print m 
    4854        (( 1.000,  0.000,  0.000,  0.000), 
     
    145151if ``m`` is a SymMatrix, then ``m[2, 4]`` addresses the same element as ``m[4, 2]``. 
    146152 
    147 .. literalinclude:: code/symmatrix.py 
    148     :lines: 1-6 
     153.. 
     154    .. literalinclude:: code/symmatrix.py 
     155        :lines: 1-6 
     156 
     157>>> import Orange 
     158>>> m = Orange.misc.SymMatrix(4) 
     159>>> for i in range(4): 
     160...    for j in range(i+1): 
     161...        m[i, j] = (i+1)*(j+1) 
     162 
    149163 
    150164Although only the lower left half of the matrix was set explicitely,  
     
    161175 
    162176>>> print m[1] 
    163 (3.0, 6.0, 9.0, 0.0) 
     177(2.0, 4.0, 6.0, 8.0) 
    164178>>> m.matrix_type = m.Lower 
    165179>>> for row in m: 
     
    335349        >>> for i in range(100): 
    336350        ...    progress.advance() 
    337         ...    # Or 
    338         ...    progress.set_state(i) 
     351        ...    # Or progress.set_state(i) 
    339352        ...    time.sleep(0.01) 
    340353        ... 
     
    683696    """ Return a property object that accesses an attribute named `new_name` 
    684697    and raises a deprecation warning when doing so. 
     698 
     699    .. 
     700 
     701        >>> sys.stderr = sys.stdout 
    685702     
    686703    Example :: 
     
    694711        >>> a = A() 
    695712        >>> print a.myAttr 
    696         __main__:1: DeprecationWarning: 'myAttr' is deprecated. Use 'my_attr' instead! 
     713        ...:1: DeprecationWarning: 'myAttr' is deprecated. Use 'my_attr' instead! 
    697714        123 
    698715         
  • Orange/misc/counters.py

    r9871 r9940  
    1919    One way to use the counter is within a for-loop: 
    2020 
    21     >>> for r in Orange.misc.counters.BooleanCounter(3): 
     21    >>> for r in BooleanCounter(3): 
    2222    ...    print r 
    2323    [0, 0, 0] 
     
    3232    You can also call it manually. 
    3333 
    34     >>> r = Orange.misc.counters.BooleanCounter(3) 
     34    >>> r = BooleanCounter(3) 
    3535    >>> r.next() 
    3636    [0, 0, 0] 
     
    8080    from 0 to 1, but to the limits that are specified individually for each digit. 
    8181 
    82     >>> for t in Orange.misc.counters.LimitedCounter([3, 5, 2]): 
     82    >>> for t in LimitedCounter([3, 5]): 
    8383    ...     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] 
     84    [0, 0] 
     85    [0, 1] 
     86    [0, 2] 
     87    [0, 3] 
     88    [0, 4] 
     89    [1, 0] 
     90    [1, 1] 
     91    [1, 2] 
     92    [1, 3] 
     93    [1, 4] 
     94    [2, 0] 
     95    [2, 1] 
     96    [2, 2] 
     97    [2, 3] 
     98    [2, 4] 
    9899 
    99100    .. attribute:: state 
     
    139140    Counter returns all consecutive subset lists of length ``m`` out of ``n`` where ``m`` <= ``n``. 
    140141 
    141     >>> for t in Orange.misc.counters.MofNCounter(3,7): 
     142    >>> for t in MofNCounter(3,7): 
    142143    ...     print t 
    143144    ... 
     
    203204    Or, with an example 
    204205 
    205     >>> for t in Orange.misc.counters.NondecreasingCounter(4): 
     206    >>> for t in NondecreasingCounter(4): 
    206207    ...     print t 
    207208    ... 
     
    258259    The sequences generated are equivalent to all possible functions from a set of cardinality of the sequences length. 
    259260 
    260     >>> for t in Orange.misc.counters.CanonicFuncCounter(4): 
     261    >>> for t in CanonicFuncCounter(4): 
    261262    ...     print t 
    262263    ... 
  • Orange/misc/r.py

    r9671 r9919  
    5050        return na if value.isSpecial() else fn(value) 
    5151     
    52     if attr.var_type == Orange.data.variable.Variable.Continuous: 
     52    if attr.var_type == Orange.feature.Descriptor.Continuous: 
    5353        return robjects.FloatVector([cv(ex[attr], float, NA_Real) for ex in data]) 
    54     elif attr.var_type == Orange.data.variable.Variable.Discrete: 
     54    elif attr.var_type == Orange.feature.Descriptor.Discrete: 
    5555        return robjects.r("factor")(robjects.StrVector([cv(ex[attr], str, NA_Char) for ex in data])) 
    56     elif attr.var_type == Orange.data.variable.Variable.String: 
     56    elif attr.var_type == Orange.feature.Descriptor.String: 
    5757        return robjects.StrVector([cv(ex[attr], str, NA_Char) for ex in data]) 
    5858    else: 
     
    6666    if not variables: 
    6767        variables = [ attr for attr in data.domain.variables if attr.var_type in \ 
    68                  [ Orange.data.variable.Variable.Continuous,  
    69                    Orange.data.variable.Variable.Discrete,  
    70                    Orange.data.variable.Variable.String ] ] 
     68                 [ Orange.feature.Descriptor.Continuous,  
     69                   Orange.feature.Descriptor.Discrete,  
     70                   Orange.feature.Descriptor.String ] ] 
    7171            
    7272    odata = [] 
  • Orange/misc/testing.py

    r9671 r9919  
    358358        """ Default test case for Orange learners. 
    359359        """ 
    360         if isinstance(dataset.domain.class_var, Orange.data.variable.Discrete): 
     360        if isinstance(dataset.domain.class_var, Orange.feature.Discrete): 
    361361            indices = _MakeRandomIndices2(p0=0.3, stratified=True)(dataset) 
    362362        else: 
     
    410410         
    411411        for ex in test: 
    412             if isinstance(dataset.domain.class_var, Orange.data.variable.Continuous): 
     412            if isinstance(dataset.domain.class_var, Orange.feature.Continuous): 
    413413                # Test to third digit after the decimal point 
    414414                self.assertAlmostEqual(classifier(ex, orange.GetValue).native(), 
  • Orange/multilabel/lp.py

    r9671 r9922  
    5050 
    5151def transform_to_powerset(instances): 
    52     new_class = Orange.data.variable.Discrete("label") 
     52    new_class = Orange.feature.Discrete("label") 
    5353     
    5454    for e in instances: 
  • Orange/multilabel/mulan.py

    r9671 r9927  
    33from xml.dom.minidom import Node 
    44 
    5 def trans_mulan_data(xml_name,arff_name, create_on_new = Orange.data.variable.Variable.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/multitarget/tree.py

    r9671 r9922  
    9292         
    9393        :param feature: Continuous feature to be split. 
    94         :type feature: :class:`Orange.data.variable` 
     94        :type feature: :class:`Orange.feature.Descriptor` 
    9595 
    9696        :param data: The data set to be split using the given continuous feature. 
     
    119119 
    120120        :param feature: Continuous feature to be split. 
    121         :type feature: :class:`Orange.data.variable` 
     121        :type feature: :class:`Orange.feature.Descriptor` 
    122122 
    123123        :param data: The data set to be split using the given continuous feature. 
     
    134134        """ 
    135135        :param feature: The feature to be scored. 
    136         :type feature: :class:`Orange.data.variable` 
     136        :type feature: :class:`Orange.feature.Descriptor` 
    137137 
    138138        :param data: The data set on which to score the feature. 
  • Orange/network/community.py

    r9671 r9922  
    2626        items = Orange.core.Preprocessor_ignore(items, attributes=exclude) 
    2727 
    28     attrs = [Orange.data.variable.Discrete('clustering label propagation', 
     28    attrs = [Orange.feature.Discrete('clustering label propagation', 
    2929                            values=list(set([l for l in lblhistory[-1]])))] 
    3030 
     
    4545        items = Orange.core.Preprocessor_ignore(items, attributes=exclude) 
    4646 
    47     attrs = [Orange.data.variable.Discrete('c' + str(i), values=list(set(\ 
     47    attrs = [Orange.feature.Discrete('c' + str(i), values=list(set(\ 
    4848            [l for l in lblhistory[0]]))) for i, _ in enumerate(lblhistory)] 
    4949 
  • Orange/network/deprecated.py

    r9671 r9922  
    616616        :param matrix: number of objects in a matrix must match the number  
    617617            of vertices in a network. 
    618         :type matrix: Orange.core.SymMatrix 
     618        :type matrix: Orange.misc.SymMatrix 
    619619        :param lower: lower distance bound. 
    620620        :type lower: float 
     
    14541454        self.mdsStep = 0 
    14551455        self.stopMDS = 0 
    1456         self.vertexDistance.matrixType = Orange.core.SymMatrix.Symmetric 
     1456        self.vertexDistance.matrixType = Orange.misc.SymMatrix.Symmetric 
    14571457        self.diag_coors = math.sqrt((min(self.graph.coors[0]) -  \ 
    14581458                                     max(self.graph.coors[0]))**2 + \ 
     
    17821782                     
    17831783        if results2items and not resultHistory2items: 
    1784             attrs = [Orange.data.variable.Discrete( 
     1784            attrs = [Orange.feature.Discrete( 
    17851785                                        'clustering label propagation', 
    17861786                                        values=list(set([l for l \ 
     
    17931793                self.net.items = Orange.data.Table([self.net.items, data]) 
    17941794        if resultHistory2items: 
    1795             attrs = [Orange.data.variable.Discrete('c'+ str(i), 
     1795            attrs = [Orange.feature.Discrete('c'+ str(i), 
    17961796                values=list(set([l for l in lblhistory[0]]))) for i,labels \ 
    17971797                in enumerate(lblhistory)] 
  • Orange/network/network.py

    r9671 r9916  
    797797        self.mdsStep = 0 
    798798        self.stopMDS = 0 
    799         self.items_matrix.matrixType = Orange.core.SymMatrix.Symmetric 
     799        self.items_matrix.matrixType = Orange.misc.SymMatrix.Symmetric 
    800800        self.diag_coors = math.sqrt((min(self.coors[0]) - \ 
    801801                                     max(self.coors[0])) ** 2 + \ 
  • Orange/preprocess/__init__.py

    r9755 r9923  
    3131    declares values that do not appear in the data. 
    3232 
    33     :param variable: :class:`Orange.data.variable.Variable` 
     33    :param variable: :class:`Orange.feature.Descriptor` 
    3434    :param data: :class:`Orange.data.Table` 
    3535    :param remove_one_valued: Decides whether to remove or to retain 
  • Orange/preprocess/outliers.py

    r9765 r9915  
    9494        other distance measures 
    9595        """ 
    96         self.distmatrix = Orange.core.SymMatrix(len(self.examples)) #FIXME  
     96        self.distmatrix = Orange.misc.SymMatrix(len(self.examples)) #FIXME  
    9797        for i in range(len(self.examples)): 
    9898            for j in range(i + 1): 
  • Orange/preprocess/scaling.py

    r9702 r9923  
    677677        if self.data_domain.class_var: 
    678678            domain = settings_dict.get("domain") or \ 
    679                      Orange.data.Domain([Orange.data.variable.Continuous("xVar"), 
    680                                          Orange.data.variable.Continuous("yVar"), 
    681                                          Orange.data.variable.Discrete(self.data_domain.class_var.name, 
     679                     Orange.data.Domain([Orange.feature.Continuous("xVar"), 
     680                                         Orange.feature.Continuous("yVar"), 
     681                                         Orange.feature.Discrete(self.data_domain.class_var.name, 
    682682                                                                       values = get_variable_values_sorted(self.data_domain.class_var))]) 
    683683        else: 
    684684            domain = settings_dict.get("domain") or \ 
    685                      Orange.data.Domain([Orange.data.variable.Continuous("xVar"), 
    686                                          Orange.data.variable.Continuous("yVar")]) 
     685                     Orange.data.Domain([Orange.feature.Continuous("xVar"), 
     686                                         Orange.feature.Continuous("yVar")]) 
    687687        data = self.create_projection_as_numeric_array(attr_indices, 
    688688                                                       **settings_dict) 
     
    10031003        if self.data_domain.class_var: 
    10041004            domain = settings_dict.get("domain") or \ 
    1005                      Orange.data.Domain([Orange.data.variable.Continuous("xVar"), 
    1006                                          Orange.data.variable.Continuous("yVar"), 
    1007                                          Orange.data.variable.Continuous("zVar"), 
    1008                                          Orange.data.variable.Discrete(self.data_domain.class_var.name, 
     1005                     Orange.data.Domain([Orange.feature.Continuous("xVar"), 
     1006                                         Orange.feature.Continuous("yVar"), 
     1007                                         Orange.feature.Continuous("zVar"), 
     1008                                         Orange.feature.Discrete(self.data_domain.class_var.name, 
    10091009                                                                       values=get_variable_values_sorted(self.data_domain.class_var))]) 
    10101010        else: 
    10111011            domain = settings_dict.get("domain") or \ 
    1012                      Orange.data.Domain([Orange.data.variable.Continuous("xVar"), 
    1013                                          Orange.data.variable.Continuous("yVar"), 
    1014                                          Orange.data.variable.Continuous("zVar")]) 
     1012                     Orange.data.Domain([Orange.feature.Continuous("xVar"), 
     1013                                         Orange.feature.Continuous("yVar"), 
     1014                                         Orange.feature.Continuous("zVar")]) 
    10151015        data = self.create_projection_as_numeric_array(attr_indices, 
    10161016                                                       **settings_dict) 
     
    11871187        if self.data_domain.class_var: 
    11881188            domain = settings_dict.get("domain") or \ 
    1189                      Orange.data.Domain([Orange.data.variable.Continuous("xVar"), 
    1190                                          Orange.data.variable.Continuous("yVar"), 
    1191                                          Orange.data.variable.Discrete(self.data_domain.class_var.name, 
     1189                     Orange.data.Domain([Orange.feature.Continuous("xVar"), 
     1190                                         Orange.feature.Continuous("yVar"), 
     1191                                         Orange.feature.Discrete(self.data_domain.class_var.name, 
    11921192                                                                       values = get_variable_values_sorted(self.data_domain.class_var))]) 
    11931193        else: 
    11941194            domain = settings_dict.get("domain") or \ 
    1195                      Orange.data.Domain([Orange.data.variable.Continuous("xVar"), 
    1196                                          Orange.data.variable.Continuous("yVar")]) 
     1195                     Orange.data.Domain([Orange.feature.Continuous("xVar"), 
     1196                                         Orange.feature.Continuous("yVar")]) 
    11971197        data = self.create_projection_as_numeric_array(attr_list, **settings_dict) 
    11981198        if data != None: 
     
    14131413        if self.data_has_class: 
    14141414            domain = settings_dict.get("domain") or \ 
    1415                      Orange.data.Domain([Orange.data.variable.Continuous(self.data_domain[attr_indices[0]].name), 
    1416                                          Orange.data.variable.Continuous(self.data_domain[attr_indices[1]].name), 
    1417                                          Orange.data.variable.Discrete(self.data_domain.class_var.name, 
     1415                     Orange.data.Domain([Orange.feature.Continuous(self.data_domain[attr_indices[0]].name), 
     1416                                         Orange.feature.Continuous(self.data_domain[attr_indices[1]].name), 
     1417                                         Orange.feature.Discrete(self.data_domain.class_var.name, 
    14181418                                                                       values = get_variable_values_sorted(self.data_domain.class_var))]) 
    14191419        else: 
    14201420            domain = settings_dict.get("domain") or \ 
    1421                      Orange.data.Domain([Orange.data.variable.Continuous(self.data_domain[attr_indices[0]].name), 
    1422                                          Orange.data.variable.Continuous(self.data_domain[attr_indices[1]].name)]) 
     1421                     Orange.data.Domain([Orange.feature.Continuous(self.data_domain[attr_indices[0]].name), 
     1422                                         Orange.feature.Continuous(self.data_domain[attr_indices[1]].name)]) 
    14231423 
    14241424        data = self.create_projection_as_numeric_array(attr_indices, 
     
    14411441        if self.data_has_class: 
    14421442            domain = settings_dict.get("domain") or \ 
    1443                      Orange.data.Domain([Orange.data.variable.Continuous(self.data_domain[attr_indices[0]].name), 
    1444                                          Orange.data.variable.Continuous(self.data_domain[attr_indices[1]].name), 
    1445                                          Orange.data.variable.Continuous(self.data_domain[attr_indices[2]].name), 
    1446                                          Orange.data.variable.Discrete(self.data_domain.class_var.name, 
     1443                     Orange.data.Domain([Orange.feature.Continuous(self.data_domain[attr_indices[0]].name), 
     1444                                         Orange.feature.Continuous(self.data_domain[attr_indices[1]].name), 
     1445                                         Orange.feature.Continuous(self.data_domain[attr_indices[2]].name), 
     1446                                         Orange.feature.Discrete(self.data_domain.class_var.name, 
    14471447                                                                       values = get_variable_values_sorted(self.data_domain.class_var))]) 
    14481448        else: 
    14491449            domain = settings_dict.get("domain") or \ 
    1450                      Orange.data.Domain([Orange.data.variable.Continuous(self.data_domain[attr_indices[0]].name), 
    1451                                          Orange.data.variable.Continuous(self.data_domain[attr_indices[1]].name), 
    1452                                          Orange.data.variable.Continuous(self.data_domain[attr_indices[2]].name)]) 
     1450                     Orange.data.Domain([Orange.feature.Continuous(self.data_domain[attr_indices[0]].name), 
     1451                                         Orange.feature.Continuous(self.data_domain[attr_indices[1]].name), 
     1452                                         Orange.feature.Continuous(self.data_domain[attr_indices[2]].name)]) 
    14531453 
    14541454        data = self.create_projection_as_numeric_array_3D(attr_indices, 
     
    15281528         
    15291529        jitter_size = 0.001 * self.clusterOptimization.jitterDataBeforeTriangulation 
    1530         domain = Orange.data.Domain([Orange.data.variable.Continuous("xVar"), 
    1531                                      Orange.data.variable.Continuous("yVar"), 
     1530        domain = Orange.data.Domain([Orange.feature.Continuous("xVar"), 
     1531                                     Orange.feature.Continuous("yVar"), 
    15321532                                    self.data_domain.class_var]) 
    15331533 
  • Orange/projection/linear.py

    r9880 r9916  
    397397        if distances: 
    398398            if n_valid != len(valid_data): 
    399                 classes = Orange.core.SymMatrix(n_valid) 
     399                classes = Orange.misc.SymMatrix(n_valid) 
    400400                r = 0 
    401401                for ro, vr in enumerate(valid_data): 
  • Orange/projection/mds.py

    r9725 r9916  
    177177     
    178178    :param distances: original dissimilarity - a distance matrix to operate on. 
    179     :type distances: :class:`Orange.core.SymMatrix` 
     179    :type distances: :class:`Orange.misc.SymMatrix` 
    180180     
    181181    :param dim: dimension of the projected space. 
     
    194194    .. attribute:: distances 
    195195     
    196        An :class:`Orange.core.SymMatrix` containing the distances that we 
     196       An :class:`Orange.misc.SymMatrix` containing the distances that we 
    197197       want to achieve (lsmt changes these). 
    198198        
    199199    .. attribute:: projected_distances 
    200200 
    201        An :class:`Orange.core.SymMatrix` containing the distances between 
     201       An :class:`Orange.misc.SymMatrix` containing the distances between 
    202202       projected points. 
    203203        
    204204    .. attribute:: original_distances 
    205205 
    206        An :class:`Orange.core.SymMatrix` containing the original distances 
     206       An :class:`Orange.misc.SymMatrix` containing the original distances 
    207207       between points. 
    208208        
    209209    .. attribute:: stress 
    210210        
    211        An :class:`Orange.core.SymMatrix` holding the stress. 
     211       An :class:`Orange.misc.SymMatrix` holding the stress. 
    212212     
    213213    .. attribute:: dim 
     
    232232    def __init__(self, distances=None, dim=2, **kwargs): 
    233233        self.mds=orangemds.MDS(distances, dim, **kwargs) 
    234         self.original_distances=Orange.core.SymMatrix([m for m in self.distances]) 
     234        self.original_distances=Orange.misc.SymMatrix([m for m in self.distances]) 
    235235 
    236236    def __getattr__(self, name): 
  • 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

    r9671 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  
     
    8282    .. attribute:: varType 
    8383 
    84         The type of the outer variable (:obj:`Orange.data.Type`, usually 
    85         :obj:`Orange.data.variable.Discrete` or 
    86         :obj:`Orange.data.variable.Continuous`); equals 
     84        The type of the outer variable (:obj:`Orange.feature.Type`, usually 
     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

    r9697 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) 
     
    356356 
    357357    for d in dist: 
    358         if d.variable.var_type == Orange.data.Type.Discrete: 
     358        if d.variable.var_type == Orange.feature.Type.Discrete: 
    359359             print "%30s: %s" % (d.variable.name, d) 
    360360        else: 
  • 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_hclustering.py

    r9724 r9915  
    7474             [13,  9, 14, 15,  7,  8,  4,  6], 
    7575             [12, 10, 11, 15,  2,  5,  7,  3,  1]] 
    76         self.matrix = Orange.core.SymMatrix(m) 
     76        self.matrix = Orange.misc.SymMatrix(m) 
    7777        self.matrix.setattr("objects", ["Ann", "Bob", "Curt", "Danny", "Eve", "Fred", "Greg", "Hue", "Ivy", "Jon"]) 
    7878        self.cluster = hier.HierarchicalClustering(self.matrix) 
  • Orange/testing/unit/tests/test_refactoring.py

    r9862 r9910  
    33 
    44""" 
    5 import sys, os 
    65import unittest 
    76 
     
    2625     
    2726def rhasattr(obj, name): 
     27    """ Recursive hasattr. 
     28    """ 
    2829    while "." in name: 
    2930        first, name = name.split(".", 1) 
     
    3536 
    3637def rgetattr(obj, name): 
     38    """ Recursive getattr  
     39    """ 
    3740    while "." in name: 
    3841        first, name = name.split(".", 1) 
     
    4548 
    4649def import_package(name): 
     50    """ Import a package and return it. 
     51    """ 
    4752    mod = __import__(name) 
    4853    if "." in name: 
     
    6671             
    6772             
    68             self.assertTrue(rhasattr(old_mod, old_name), "{0} is missing".format(old)) 
    69             self.assertTrue(rhasattr(new_mod, new_name), "{0} is missing".format(new)) 
     73            self.assertTrue(rhasattr(old_mod, old_name),  
     74                            "{0} is missing".format(old)) 
     75            self.assertTrue(rhasattr(new_mod, new_name), 
     76                            "{0} is missing".format(new)) 
    7077             
    7178    def test_import_mapping(self): 
     
    7683     
    7784             
    78              
    7985if __name__ == "__main__": 
    8086    unittest.main() 
  • Orange/testing/unit/tests/test_variable.py

    r9679 r9927  
    77        """ Test Variable.make 
    88        """ 
    9         v1, s = Orange.data.variable.make("test_variable_a", 
    10                                       Orange.data.Type.Discrete,["a", "b"]) 
    11         v2, s = Orange.data.variable.make("test_variable_a", 
    12                                       Orange.data.Type.Discrete, ["a"], ["c"]) 
     9        v1, s = Orange.feature.Descriptor.make("test_variable_a", 
     10                                      Orange.feature.Type.Discrete,["a", "b"]) 
     11        v2, s = Orange.feature.Descriptor.make("test_variable_a", 
     12                                      Orange.feature.Type.Discrete, ["a"], ["c"]) 
    1313        self.assertIs(v2, v1) 
    1414         
    15         v3, s = Orange.data.variable.make("test_variable_a", 
    16                           Orange.data.Type.Discrete, ["a", "b", "c", "d"]) 
     15        v3, s = Orange.feature.Descriptor.make("test_variable_a", 
     16                          Orange.feature.Type.Discrete, ["a", "b", "c", "d"]) 
    1717        self.assertIs(v3, v1) 
    1818         
    19         v4, s = Orange.data.variable.make("test_variable_a", 
    20                                      Orange.data.Type.Discrete, ["b"]) 
     19        v4, s = Orange.feature.Descriptor.make("test_variable_a", 
     20                                     Orange.feature.Type.Discrete, ["b"]) 
    2121        self.assertIsNot(v4, v1) 
    2222         
    23         v5, s = Orange.data.variable.make("test_variable_a", 
    24                              Orange.data.Type.Discrete, None, ["c", "a"]) 
     23        v5, s = Orange.feature.Descriptor.make("test_variable_a", 
     24                             Orange.feature.Type.Discrete, None, ["c", "a"]) 
    2525        self.assertIs(v5, v1) 
    2626         
    27         v6, s = Orange.data.variable.make("test_variable_a",  
    28                             Orange.data.Type.Discrete, None, ["e"]) 
     27        v6, s = Orange.feature.Descriptor.make("test_variable_a",  
     28                            Orange.feature.Type.Discrete, None, ["e"]) 
    2929        self.assertIs(v6, v1) 
    3030         
    31         v7, s = Orange.data.variable.make("test_variable_a", 
    32                                  Orange.data.Type.Discrete, None, ["f"], 
    33                                  Orange.data.variable.Variable.MakeStatus.NoRecognizedValues) 
     31        v7, s = Orange.feature.Descriptor.make("test_variable_a", 
     32                                 Orange.feature.Type.Discrete, None, ["f"], 
     33                                 Orange.feature.Descriptor.MakeStatus.NoRecognizedValues) 
    3434        self.assertIsNot(v7, v1) 
    3535         
    36         v8, s = Orange.data.variable.make("test_variable_a", 
    37                                      Orange.data.Type.Discrete, 
     36        v8, s = Orange.feature.Descriptor.make("test_variable_a", 
     37                                     Orange.feature.Type.Discrete, 
    3838                                     ["a", "b", "c", "d", "e"], None, 
    39                                      Orange.data.variable.Variable.MakeStatus.OK) 
     39                                     Orange.feature.Descriptor.MakeStatus.OK) 
    4040        self.assertIsNot(v8, v1) 
    4141         
  • docs/extend-widgets/rst/conf.py

    r9402 r9917  
    1717# add these directories to sys.path here. If the directory is relative to the 
    1818# documentation root, use os.path.abspath to make it absolute, like shown here. 
    19 #sys.path.append(os.path.abspath('.')) 
     19sys.path.append(os.path.abspath('../../../orange')) 
     20import Orange 
    2021 
    2122# -- General configuration ----------------------------------------------------- 
  • docs/extend-widgets/rst/index.rst

    r9402 r9917  
    33########################## 
    44 
    5 Contents: 
     5.. toctree:: 
     6   :maxdepth: 3 
     7 
     8   OrangeWidgets.plot 
    69 
    710**************** 
     
    1013 
    1114* :ref:`genindex` 
     15* :ref:`modindex` 
    1216* :ref:`search` 
  • 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.rst

    r9901 r9941  
    1212    Orange.data.formats 
    1313    Orange.data.discretization 
     14    Orange.data.continuization 
  • 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.evaluation.scoring.rst

    r9892 r9904  
    114114   data set, we would compute the matrix like this:: 
    115115 
    116       cm = Orange.evaluation.scoring.confusion_matrices(resVeh, \ 
    117 vehicle.domain.classVar.values.index("van")) 
     116      cm = Orange.evaluation.scoring.confusion_matrices(resVeh, vehicle.domain.classVar.values.index("van")) 
    118117 
    119118   and get the results like these:: 
     
    177176   classes, you can also compute the 
    178177   `sensitivity <http://en.wikipedia.org/wiki/Sensitivity_(tests)>`_ 
    179    [TP/(TP+FN)], `specificity \ 
    180 <http://en.wikipedia.org/wiki/Specificity_%28tests%29>`_ 
    181    [TN/(TN+FP)], `positive predictive value \ 
    182 <http://en.wikipedia.org/wiki/Positive_predictive_value>`_ 
    183    [TP/(TP+FP)] and `negative predictive value \ 
    184 <http://en.wikipedia.org/wiki/Negative_predictive_value>`_ [TN/(TN+FN)]. 
     178   [TP/(TP+FN)], `specificity <http://en.wikipedia.org/wiki/Specificity_%28tests%29>`_ 
     179   [TN/(TN+FP)], `positive predictive value <http://en.wikipedia.org/wiki/Positive_predictive_value>`_ 
     180   [TP/(TP+FP)] and `negative predictive value <http://en.wikipedia.org/wiki/Negative_predictive_value>`_ [TN/(TN+FN)]. 
    185181   In information retrieval, positive predictive value is called precision 
    186182   (the ratio of the number of relevant records retrieved to the total number 
     
    195191   as F1 [2*precision*recall/(precision+recall)] or, for a general case, 
    196192   Falpha [(1+alpha)*precision*recall / (alpha*precision + recall)]. 
    197    The `Matthews correlation coefficient \ 
    198 <http://en.wikipedia.org/wiki/Matthews_correlation_coefficient>`_ 
     193   The `Matthews correlation coefficient <http://en.wikipedia.org/wiki/Matthews_correlation_coefficient>`_ 
    199194   in essence a correlation coefficient between 
    200195   the observed and predicted binary classifications; it returns a value 
  • 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

    r9943 r9944  
    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.feature.imputation.rst

    r9890 r9905  
    282282capable of handling unknown values. 
    283283 
    284 Learners with imputer as a component 
    285 ==================================== 
     284Imputer as a component 
     285====================== 
    286286 
    287287Learners that cannot handle missing values should provide a slot 
     
    292292:obj:`~Orange.classification.logreg.LogRegLearner` will pass them to 
    293293:obj:`~Orange.classification.logreg.LogRegLearner.imputer_constructor` to get 
    294 an imputer and used it to impute the missing values in the learning data. 
    295 Imputed data is then used by the actual learning algorithm. Also, when a 
     294an imputer and use it to impute the missing values in the learning data. 
     295Imputed data is then used by the actual learning algorithm. When a 
    296296classifier :obj:`~Orange.classification.logreg.LogRegClassifier` is 
    297 constructed, 
    298 the imputer is stored in its attribute 
    299 :obj:`~Orange.classification.logreg.LogRegClassifier.imputer`. At 
    300 classification, the same imputer is used for imputation of missing values 
     297constructed, the imputer is stored in its attribute 
     298:obj:`~Orange.classification.logreg.LogRegClassifier.imputer`. During 
     299classification the same imputer is used for imputation of missing values 
    301300in (testing) examples. 
    302301 
     
    305304it is recommended to use imputation according to the described procedure. 
    306305 
    307 The choice of which imputer to use depends on the problem domain. In this 
    308 example we want to impute the minimal value of each feature. 
     306The choice of the imputer depends on the problem domain. In this example the 
     307minimal value of each feature is imputed: 
    309308 
    310309.. literalinclude:: code/imputation-logreg.py 
     
    318317.. note:: 
    319318 
    320    Note that just one instance of 
     319   Just one instance of 
    321320   :obj:`~Orange.classification.logreg.LogRegLearner` is constructed and then 
    322321   used twice in each fold. Once it is given the original instances as they 
     
    329328   testing. 
    330329 
    331 Wrapper for learning algorithms 
    332 =============================== 
     330Wrappers for learning 
     331===================== 
    333332 
    334333In a learning/classification process, imputation is needed on two occasions. 
    335 Before learning, the imputer needs to process the training examples. 
     334Before learning, the imputer needs to process the training instances. 
    336335Afterwards, the imputer is called for each instance to be classified. For 
    337336example, in cross validation, imputation should be done on training folds 
     
    343342simply skips the corresponding attributes in the formula, while 
    344343classification/regression trees have components for handling the missing 
    345 values in various ways. 
    346  
    347 If for any reason you want to use these algorithms to run on imputed data, 
    348 you can use this wrapper. 
     344values in various ways. A wrapper is provided for learning algorithms that 
     345require imputed data. 
    349346 
    350347.. class:: ImputeLearner 
  • 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 
  • docs/reference/rst/index.rst

    r9897 r9917  
    4040   Orange.misc 
    4141 
    42    OrangeWidgets.plot 
    43  
    4442**************** 
    4543Index and search 
  • install-scripts/createSnapshot.btm

    r9730 r9909