Changeset 9929:6df3696524a2 in orange


Ignore:
Timestamp:
02/07/12 16:48:45 (2 years ago)
Author:
markotoplak
Branch:
default
rebase_source:
4bf098bb79507887de1226bdf4200ba88b769ab9
Message:

data.variable -> feature.

Files:
1 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • Orange/__init__.py

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

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

    r9919 r9929  
    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.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.new_meta_id() 
    17341734            instances.addMetaAttribute(weights, 1.) 
    17351735            instances.domain.addmeta(weights, Orange.feature.\ 
    17361736                Continuous("weights-" + str(weights)), True) 
    1737         newWeightsID = Orange.data.new_meta_id() 
     1737        newWeightsID = Orange.feature.new_meta_id() 
    17381738        instances.addMetaAttribute(newWeightsID, 1.) 
    17391739        instances.domain.addmeta(newWeightsID, Orange.feature.\ 
     
    17561756    def __call__(self, rule, instances, weights, target_class): 
    17571757        if not weights: 
    1758             weights = Orange.data.new_meta_id() 
     1758            weights = Orange.feature.new_meta_id() 
    17591759            instances.addMetaAttribute(weights, 1.) 
    17601760            instances.domain.addmeta(weights, Orange.feature.\ 
     
    17641764        except: 
    17651765            coverage = Orange.feature.Continuous("Coverage") 
    1766             instances.domain.addmeta(Orange.data.new_meta_id(), coverage, True) 
     1766            instances.domain.addmeta(Orange.feature.new_meta_id(), coverage, True) 
    17671767            instances.addMetaAttribute(coverage, 0.0) 
    1768         newWeightsID = Orange.data.new_meta_id() 
     1768        newWeightsID = Orange.feature.new_meta_id() 
    17691769        instances.addMetaAttribute(newWeightsID, 1.) 
    17701770        instances.domain.addmeta(newWeightsID, Orange.feature.\ 
     
    17871787    def __init__(self, examples, weight_id, target_class, apriori, argument_id): 
    17881788        self.best_rule = [None] * len(examples) 
    1789         self.prob_attribute = Orange.data.new_meta_id() 
     1789        self.prob_attribute = Orange.feature.new_meta_id() 
    17901790        self.apriori_prob = apriori[target_class] / apriori.abs 
    17911791        examples.addMetaAttribute(self.prob_attribute, self.apriori_prob) 
  • Orange/data/__init__.py

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

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

    r9671 r9929  
    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 
     164from Orange.feature import new_meta_id 
    163165 
    164166_row_meta_id = new_meta_id() 
  • Orange/ensemble/boosting.py

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

    r9919 r9929  
    402402        nearest_neighbours_constructor.distanceConstructor = Orange.distance.Euclidean() 
    403403         
    404         distance_id = Orange.data.new_meta_id() 
     404        distance_id = Orange.feature.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.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.new_meta_id() 
    519519        nnm = nnm(instances, 0, mid) 
    520520        return MahalanobisClassifier(self.k, nnm, mid) 
  • Orange/multilabel/multiknn.py

    r9724 r9929  
    7070        nnc.distanceConstructor = Orange.distance.Euclidean() 
    7171         
    72         weight_id = Orange.data.new_meta_id() 
     72        weight_id = Orange.feature.new_meta_id() 
    7373        self.knn = nnc(instances, 0, weight_id) 
    7474        self.weight_id = weight_id 
  • docs/reference/rst/Orange.data.domain.rst

    r9927 r9929  
    160160 
    161161     >>> misses = Orange.feature.Continuous("misses") 
    162      >>> id = Orange.data.new_meta_id() 
     162     >>> id = Orange.feature.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.new_meta_id(), domain["type"]) 
     208    new_domain.add_meta(Orange.feature.new_meta_id(), domain["legs"]) 
    209209    new_domain.add_meta( 
    210         Orange.data.new_meta_id(), Orange.feature.Discrete("X")) 
     210        Orange.feature.new_meta_id(), Orange.feature.Discrete("X")) 
    211211    data2 = Orange.data.Table(new_domain, data) 
    212212 
     
    396396 
    397397         Register a meta attribute with the given id (see 
    398          :obj:`Orange.data.new_meta_id`). The same meta attribute should 
     398         :obj:`Orange.feature.new_meta_id`). The same meta attribute should 
    399399         have the same id in all domains in which it is registered. :: 
    400400 
    401              >>> newid = Orange.data.new_meta_id() 
     401             >>> newid = Orange.feature.new_meta_id() 
    402402             >>> domain.add_meta(newid, Orange.feature.String("origin")) 
    403403             >>> data[55]["origin"] = "Nepal" 
  • docs/reference/rst/Orange.data.instance.rst

    r9927 r9929  
    126126 
    127127    ok = orange.EnumVariable("ok?", values=["no", "yes"]) 
    128     ok_id = Orange.data.new_meta_id() 
     128    ok_id = Orange.feature.new_meta_id() 
    129129    data.domain.addmeta(ok_id, ok) 
    130130    data[0][ok_id] = "yes" 
  • docs/reference/rst/Orange.feature.descriptor.rst

    r9927 r9929  
    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.new_meta_id()`). 
    6262 
    6363    .. attribute:: attributes 
  • docs/reference/rst/code/instance-metavar.py

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

    r9927 r9929  
    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.new_meta_id(), a2) 
     21new_domain.addmeta(Orange.feature.new_meta_id(), n2) 
    2222 
    2323merge = Orange.data.Instance(new_domain, [data1[0], data2[0]]) 
  • docs/reference/rst/code/knnInstanceDistance.py

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

    r9927 r9929  
    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() 
     60mid = Orange.feature.new_meta_id() 
    6161lenses.domain.add_meta(mid, Orange.feature.Discrete(values = ["v0", "v1"])) 
    6262lenses.add_meta_attribute(mid) 
Note: See TracChangeset for help on using the changeset viewer.