Ignore:
Timestamp:
02/06/12 09:49:52 (2 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
rebase_source:
7dbd33dab61c497976439380c3d737f3ad9dd9a5
Message:

Small fixed in documention of Orange.data.domain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/Orange.data.domain.rst

    r9652 r9664  
    55=============================== 
    66 
    7 In Orange, the term `domain` denotes a set of features, 
    8 meta attributes and class attribute that describe data. Domain 
    9 descriptors are attached to data instances, data tables, 
    10 classifiers and other objects. 
    11  
    12 Besides describing the data, domain descriptors contain methods for 
    13 converting data instances from one domain to another, 
    14 e.g. from the original feature space to one with different set of 
    15 features that are selected or constructed from the original set. 
    16  
    17 The following examples will use domain constructed when reading the data 
    18 set `zoo`:: 
     7In Orange, the term `domain` denotes a set of variables and meta 
     8attributes that describe data. A domain descriptor is attached to data 
     9instances, data tables, classifiers and other objects. A descriptor is 
     10constructed, for instance, after reading data from a file. 
    1911 
    2012    >>> data = Orange.data.Table("zoo") 
     
    2517    type], {-2:name} 
    2618 
    27 Domains consists of ordinary features and the class attribute, 
    28 if there is one, and of meta attributes. We will refer to features and 
    29 the class attribute as *variables*. Variables are printed out 
    30 in a form similar to a list whose elements are attribute names, 
    31 and meta attributes are printed like a dictionary whose "keys" are meta 
    32 attribute id's and "values" are attribute names. In the above case, 
    33 each data instance corresponds to an animal and is described by the 
    34 animal's properties and its type (the class); the meta attribute contains 
    35 the animal's name. 
     19Domains consists of ordinary features (from "hair" to "catsize" in the 
     20above example), the class attribute ("type"), and meta attributes 
     21("name"). We will refer to features and the class attribute as 
     22*variables*. Variables are printed out in a form similar to a list whose 
     23elements are attribute names, and meta attributes are printed like a 
     24dictionary whose "keys" are meta attribute id's and "values" are 
     25attribute names. In the above case, each data instance corresponds to an 
     26animal and is described by the animal's properties and its type (the 
     27class); the meta attribute contains the animal's name. 
    3628 
    3729Domains as lists and dictionaries 
     
    4133variables including the class variable. Domains can be indexed by integer 
    4234indices, variable names or instances of 
    43 :obj:`Orange.data.variables.Variable`:: 
     35:obj:`Orange.data.variable.Variable`:: 
    4436 
    4537    >>> domain["feathers"] 
     
    5143    EnumVariable 'feathers' 
    5244 
    53 Meta attributes are indexed similarly:: 
     45Meta attributes work the same:: 
    5446 
    5547    >>> domain[-2] 
     
    5749    >>> domain["name"] 
    5850    StringVariable 'name' 
     51 
     52 
     53Slices can be retrieved, but not set. Iterating through domain goes 
     54through features and the class variable, but not through meta attributes:: 
     55 
     56    >>> for attr in domain: 
     57    ...     print attr.name, 
     58    ... 
     59    hair feathers eggs milk airborne aquatic predator toothed backbone 
     60    breathes venomous fins legs tail domestic catsize type 
    5961 
    6062Method :obj:`Domain.index` returns the index of a variable specified by a 
     
    6870    -2 
    6971 
    70 Slices can be retrieved, but not set. 
    71  
    72 Iterating through domain goes through features and the class variable, 
    73 but not through meta attributes:: 
    74  
    75     >>> for attr in domain: 
    76     ...     print attr.name, 
    77     ... 
    78     hair feathers eggs milk airborne aquatic predator toothed backbone 
    79     breathes venomous fins legs tail domestic catsize type 
    80  
    8172 
    8273Conversions between domains 
     
    8677(details on construction of domains are described later). :: 
    8778 
    88      >>> new_domain = Orange.data.Domain(["feathers", "legs", "type"], 
    89      domain) 
     79     >>> new_domain = Orange.data.Domain(["feathers", "legs", "type"], domain) 
    9080     >>> inst = data[55] 
    9181     >>> inst 
     
    130120=============== 
    131121 
    132 Meta-values are additional values that can be attached to instances. 
    133 It is not necessary that all instances in the same table (or even all 
    134 instances from the same domain) have the same meta attributes. See 
    135 documentation on :obj:`Orange.data.Instance` for a more thorough 
    136 description of meta-values. 
     122Meta attributes hold additional data attached to individual 
     123instances. Different instances from the same domain or even the same 
     124table may have different meta attributes. See documentation on 
     125:obj:`Orange.data.Instance` for a more thorough description of meta 
     126values. 
    137127 
    138128Meta attributes that appear in instances can, but don't need to be 
Note: See TracChangeset for help on using the changeset viewer.