Changeset 7686:3ac55fafc17e in orange


Ignore:
Timestamp:
02/16/11 23:34:21 (3 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
b7539ca214f04ffce4869d42b7f84b4f7b09faaf
Message:

Finished documentation for Domain (needs checking) and fixed the TOC section on Data description

Location:
orange
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/data/__init__.py

    r7303 r7686  
    88 
    99from orange import VarTypes as Type 
     10 
     11from orange import newmetaid as new_meta_id 
  • orange/Orange/data/variable.py

    r7660 r7686  
    1616or constructs a new one. 
    1717 
    18 .. class:: variable 
     18.. class:: Variable 
    1919 
    2020    An abstract base class for variable descriptors. 
     
    2222    .. attribute:: name 
    2323 
    24         Each variable has a name. The names do not need to be unique since two 
     24        The name of the variable. Variable names do not need to be unique since two 
    2525        variables are considered the same only if they have the same descriptor 
    2626        (e.g. even multiple variables in the same table can have the same name). 
     
    3030    .. attribute:: varType 
    3131        
    32         Stores the variable type; it can be Orange.data.Type.Discrete, 
     32        Variable type; it can be Orange.data.Type.Discrete, 
    3333        Orange.data.Type.Continuous, Orange.data.Type.String or 
    3434        Orange.data.Type.Other.   
  • orange/Orange/statistics/basic.py

    r7671 r7686  
    99.. class:: Variable 
    1010 
    11     ``statistics.basic.Variable`` computes and stores minimal, maximal, average and 
     11    Computes and stores minimal, maximal, average and 
    1212    standard deviation of a variable. It does not include the median or any 
    1313    other statistics that can be computed on the fly, without remembering the 
    14     data; such statistics can be obtained classes from module :module:`Orange.statistics.distribution`. 
     14    data; such statistics can be obtained classes from module :obj:`Orange.statistics.distribution`. 
    1515 
    1616    Instances of this class are seldom constructed manually; they are more often 
  • orange/doc/Orange/rst/Orange.data.domain.rst

    r7669 r7686  
     1.. py:currentmodule:: Orange.data 
     2 
    13================== 
    24Domain description 
     
    4244    a b e y  
    4345 
     46Conversions between domains 
     47=========================== 
     48 
     49Domain descriptors are used to convert instances from one domain to 
     50another. :: 
     51 
     52     >>> data = Orange.data.Table("monk1") 
     53     >>> d2 = Orange.data.Domain(["a", "b", "e", "y"], data.domain) 
     54     >>>  
     55     >>> inst = data[55] 
     56     >>> print inst 
     57     ['1', '2', '1', '1', '4', '2', '0'] 
     58     >>> inst2 = d2(inst) 
     59     >>>  print inst2 
     60     ['1', '2', '4', '0'] 
     61 
     62This is used, for instance, in classifiers: classifiers are often 
     63trained on a preprocessed domain (e.g. with a subset of features or 
     64with discretized data) and later used on instances from the original 
     65domain. Classifiers store the training domain descriptor and use it 
     66for converting new instances. 
     67 
     68Equivalently, instances can be converted by passing the new domain to 
     69the constructor:: 
     70 
     71     >>> inst2 = Orange.data.Instance(d2, inst) 
     72 
     73Entire data table can be converted similarly:: 
     74 
     75     >>> data2 = Orange.data.Table(d2, data) 
     76     >>> print data2[55] 
     77     ['1', '2', '4', '0'] 
     78 
     79 
    4480Meta attributes 
    4581=============== 
     
    5490registered for the following reasons. 
    5591 
    56     * If the domain knows about a meta attribute, their values can be 
    57       obtained with indexing by names and variable descriptors, 
    58       e.g. ``inst["age"]``. Values of unregistered meta attributes can 
    59       be obtained only through integer indices (e.g. inst[id], where 
    60       id needs to be an integer). 
    61  
    62     * When printing out an instance, the symbolic values of discrete 
    63       meta attributes can only be printed if the attribute is 
    64       registered. Also, if the attribute is registered, the printed 
    65       out example will show a (more informative) attribute's name 
    66       instead of a meta-id. 
    67  
    68     * Registering an attribute provides a way to attach a descriptor 
    69       to a meta-id. See how the basket file format uses this feature. 
    70  
    71     * When saving instances to a file, only the values of registered 
    72       meta attributes are saved. 
    73  
    74     * When a new data instance is constructed, it is automatically 
    75       assigned the meta attributes listed in the domain, with their 
    76       values set to unknown. 
     92     * If the domain knows about a meta attribute, their values can be 
     93       obtained with indexing by names and variable descriptors, 
     94       e.g. ``inst["age"]``. Values of unregistered meta attributes can 
     95       be obtained only through integer indices (e.g. inst[id], where 
     96       id needs to be an integer). 
     97 
     98     * When printing out an instance, the symbolic values of discrete 
     99       meta attributes can only be printed if the attribute is 
     100       registered. Also, if the attribute is registered, the printed 
     101       out example will show a (more informative) attribute's name 
     102       instead of a meta-id. 
     103 
     104     * Registering an attribute provides a way to attach a descriptor 
     105       to a meta-id. See how the basket file format uses this feature. 
     106 
     107     * When saving instances to a file, only the values of registered 
     108       meta attributes are saved. 
     109 
     110     * When a new data instance is constructed, it is automatically 
     111       assigned the meta attributes listed in the domain, with their 
     112       values set to unknown. 
    77113 
    78114For the latter two points - saving to a file and construction of new 
     
    97133desription of methods related to meta attributes is given below):: 
    98134 
    99     >>> misses = Orange.data.variable.Continuous("misses") 
    100     >>> id = orange.newmetaid() 
    101     >>> data.domain.addmeta(id, misses) 
     135     >>> misses = Orange.data.variable.Continuous("misses") 
     136     >>> id = orange.new_meta_id() 
     137     >>> data.domain.add_meta(id, misses) 
    102138 
    103139This does not change the data: no attributes are added to data 
     
    108144attribute to 0 for all instances in the data table:: 
    109145 
    110     >>> for inst in data: 
    111     ...     inst[misses] = 0 
    112  
    113 An alternative is referring by name:: 
    114  
    115     >>> for inst in data: 
    116     ...     inst["misses"] = 0 
     146     >>> for inst in data: 
     147     ...     inst[misses] = 0 
     148 
     149An alternative is to refer to the attribute by name:: 
     150 
     151     >>> for inst in data: 
     152     ...     inst["misses"] = 0 
    117153 
    118154If the attribute were not registered, it could still be set using the 
    119155integer index:: 
    120156 
    121     >>> for inst in data: 
    122     ...    inst.setmeta(id, 0) 
     157     >>> for inst in data: 
     158     ...    inst.set_meta(id, 0) 
    123159 
    124160Registering the meta attribute also enhances printouts. When an instance 
     
    127163of a name. 
    128164 
    129 In a massive testing of different models, you could count the number 
    130 of times that each example was missclassified by calling classifiers 
    131 in the following loop. 
    132  
    133 domain2.py (uses monk1.tab) &gt;&gt;&gt; for example in data: ... if 
    134 example.getclass() != classifier(example): ... example[misses] += 1 
    135  
    136 The other effect of registering meta attributes is that they appear in converted examples. That is, whenever an example is converted to certain domain, the example will have all the meta attributes that are declared in that domain. If the meta attributes occur in the original domain of the example or can be computed from the attributes in the original domain, they will have appropriate values. When not, their values will be DK. 
    137 domain = data.domain d2 = orange.Domain(["a", "b", "e", "y"], domain) for attr in ["c", "d", "f"]: d2.addmeta(orange.newmetaid(), domain[attr]) d2.addmeta(orange.newmetaid(), orange.EnumVariable("X")) data2 = orange.ExampleTable(d2, data) 
    138  
    139 Domain d2 is constructed to have only the attributes a, b, e and the class attribute, while the other three attributes are added as meta attributes, among with a mysterious additional attribute X. 
    140 &gt;&gt;&gt; print data[55] ['1', '2', '1', '1', '4', '2', '0'], {"misses":0.000000} &gt;&gt;&gt; print data2[55] ['1', '2', '4', '0'], {"c":'1', "d":'1', "f":'2', "X":'?'} 
    141  
    142 After conversion, the three attributes are moved to meta attributes and the new attribute appears as unknown. 
     165A meta-attribute can be used, for instance, to record the number of 
     166misclassifications by a given ``classifier``:: 
     167 
     168     >>> for inst in data: 
     169     ... if inst.get_class() != classifier(example): 
     170     ...     example[misses] += 1 
     171 
     172The other effect of registering meta attributes is that they appear in 
     173converted instances: whenever an instances is converted to some 
     174domain, it will have all the meta attributes that are registered in 
     175that domain. If the meta attributes occur in the original domain of 
     176the instance or if they can be computed from them, they will have 
     177appropriate values, otherwise they will have a "don't know" value. :: 
     178 
     179     domain = data.domain 
     180     d2 = Orange.data.Domain(["a", "b", "e", "y"], domain) 
     181     for attr in ["c", "d", "f"]: 
     182     d2.add_meta(orange.newmetaid(), domain[attr]) 
     183     d2.add_meta(orange.newmetaid(), orange.data.variable.Discrete("X")) 
     184     data2 = Orange.data.Table(d2, data) 
     185 
     186Domain ``d2`` in this example has variables ``a``, ``b``, ``e`` and the 
     187class, while the other three variables are added as meta 
     188attributes, together with additional attribute X. Results is as 
     189follows. :: 
     190 
     191     >>> print data[55] 
     192     ['1', '2', '1', '1', '4', '2', '0'], {"misses":0.000000} 
     193     >>> print data2[55] 
     194     ['1', '2', '4', '0'], {"c":'1', "d":'1', "f":'2', "X":'?'} 
     195 
     196fter conversion, the three attributes are moved to meta attributes 
     197and the new attribute appears as unknown. 
    143198 
    144199.. class:: Domain 
    145200 
    146     .. attribute:: features 
    147  
    148         List of domain attributes 
    149         (:obj:`Orange.data.variable.Variables`) without the class 
    150         variable. Read only. 
    151  
    152     .. attribute:: variables 
    153  
    154         List of domain attributes 
    155         (:obj:`Orange.data.variable.Variables`) including the class 
    156         variable. Read only. 
    157  
    158     .. attribute:: class_var 
    159  
    160         The class variable (:obj:`Orange.data.variable.Variable`), or 
    161         :obj:`None` if there is none. Read only. 
    162  
    163     .. attribute:: version 
    164  
    165         An integer value that is changed when the domain is 
    166         modified. Can be also used as unique domain identifier; two 
    167         different domains also have different versions. 
    168  
    169     .. method:: __init__(variables) 
    170  
    171         Construct a domain with the given variables specified; the 
    172         last one is used as the class variable. :: 
    173  
    174             >>> a, b, c = [Orange.data.variable.Discrete(x) 
    175                            for x in ["a", "b", "c"]] 
    176             >>> d = Orange.data.Domain([a, b, c]) 
    177             >>> print d.features 
    178             <EnumVariable 'a', EnumVariable 'b'> 
    179             >>> print d.class_var 
    180             EnumVariable 'c' 
    181  
    182         :param variables: List of variables (instances of :obj:`Orange.data.variable.Variable`) 
    183         :type variables: list 
    184  
    185     .. method:: __init__(features, class_variable) 
    186  
    187         Construct a domain with the given list of features and the 
    188         class variable. :: 
    189  
    190             >>> d = Orange.data.Domain([a, b], c) 
    191             >>> print d.features 
    192             <EnumVariable 'a', EnumVariable 'b'> 
    193             >>> print d.class_var EnumVariable 'c' 
    194  
    195         :param features: List of features (instances of :obj:`Orange.data.variable.Variable`) 
    196         :type features: list 
    197         :param class_variable: Class variable 
    198         :type features: Orange.data.variable.Variable 
    199  
    200     .. method:: __init__(variables, has_class) 
    201  
    202         Construct a domain with the given variables. If has_class is 
    203         :obj:`True`, the last one is used as the class variable. :: 
    204  
    205             >>> d = Orange.data.Domain([a, b, c], False) 
    206             >>> print d.features 
    207             <EnumVariable 'a', EnumVariable 'b'> 
    208             >>> print d.class_var 
    209             EnumVariable 'c' 
    210  
    211         :param variables: List of variables (instances of :obj:`Orange.data.variable.Variable`) 
    212         :type features: list 
    213         :param has_class: A flag telling whether the domain has a class 
    214         :type has_class: bool 
    215  
    216     .. method:: __init__(variables, source) 
    217  
    218         Construct a domain with the given variables, which can also be 
    219         specified by names, provided that the variables with that 
    220         names exist in the source list. The last variable from the 
    221         list is used as the class variable. :: 
    222  
    223             >>> d1 = orange.Domain([a, b]) 
    224             >>> d2 = orange.Domain(["a", b, c], d1)  
    225  
    226         :param variables: List of variables (strings or instances of :obj:`Orange.data.variable.Variable`) 
    227         :type variables: list 
    228         :param source : An existing domain or a list of variables 
    229         :type source: Orange.data.Domain or list of 
    230         :obj:`Orange.data.variable.Variable` 
    231  
    232     .. method:: __init__(variables, has_class, source) 
    233  
    234         Similar to above except for the flag which tells whether the 
    235         last variable should be used as the class variable. :: 
    236  
    237             >>> d1 = orange.Domain([a, b]) 
    238             >>> d2 = orange.Domain(["a", b, c], d1)  
    239  
    240         :param variables: List of variables (strings or instances of :obj:`Orange.data.variable.Variable`) 
    241         :type variables: list 
    242         :param has_class: A flag telling whether the domain has a class 
    243         :type has_class: bool 
    244         :param source : An existing domain or a list of variables 
    245         :type source: Orange.data.Domain or list of 
    246         :obj:`Orange.data.variable.Variable` 
    247  
    248     .. method:: __init__(domain, class_var) 
    249  
    250         Construct a domain as a shallow copy of an existing domain 
    251         except that the class variable is replaced with the given one 
    252         and the class variable of the existing domain becoems an 
    253         ordinary feature. If the new class is one of the original 
    254         domain's features, it can also be specified by a name. 
    255  
    256         :param domain: An existing domain 
    257         :type domain: :obj:`Orange.variable.Domain` 
    258         :param class_var: Class variable for the new domain 
    259         :type class_var: string or :obj:`Orange.data.variable.Variable` 
    260  
    261     .. method:: __init__(domain[, has_class]) 
    262  
    263         Construct a shallow copy of the domain. If the ``has_class`` 
    264         flag is given and equals :obj:`False`, it moves the class 
    265         attribute to ordinary features. 
    266  
    267         :param domain: An existing domain 
    268         :type domain: :obj:`Orange.variable.Domain` 
    269         :param has_class: A flag telling whether the domain has a class 
    270         :type has_class: bool 
    271  
    272     .. method:: has_discrete_attributes([include_class=True]) 
    273  
    274         Return :obj:`True` if the domain has any discrete variables; 
    275         class is considered unless ``include_class`` is ``False``. 
    276  
    277         :param has_class: Tells whether to consider the class variable 
    278         :type has_class: bool 
    279         :rtype: bool 
    280  
    281     .. method:: has_continuous_attributes([include_class=True]) 
    282  
    283         Return :obj:`True` if the domain has any continuous variables; 
    284         class is considered unless ``include_class`` is ``False``. 
    285  
    286         :param has_class: Tells whether to consider the class variable 
    287         :type has_class: bool 
    288         :rtype: bool 
    289  
    290     .. method:: has_other_attributes([include_class=True]) 
    291  
    292         Return :obj:`True` if the domain has any variables which are 
    293         neither discrete nor continuous, such as, for instance string variables. 
    294         class is considered unless ``include_class`` is ``False``. 
    295  
    296         :param has_class: Tells whether to consider the class variable 
    297         :type has_class: bool 
    298         :rtype: bool 
     201     .. attribute:: features 
     202 
     203     List of domain attributes 
     204     (:obj:`Orange.data.variable.Variables`) without the class 
     205     variable. Read only. 
     206 
     207     .. attribute:: variables 
     208 
     209     List of domain attributes 
     210     (:obj:`Orange.data.variable.Variables`) including the class 
     211     variable. Read only. 
     212 
     213     .. attribute:: class_var 
     214 
     215     The class variable (:obj:`Orange.data.variable.Variable`), or 
     216     :obj:`None` if there is none. Read only. 
     217 
     218     .. attribute:: version 
     219 
     220     An integer value that is changed when the domain is 
     221     modified. Can be also used as unique domain identifier; two 
     222     different domains also have different versions. 
     223 
     224     .. method:: __init__(variables) 
     225 
     226     Construct a domain with the given variables specified; the 
     227     last one is used as the class variable. :: 
     228 
     229         >>> a, b, c = [Orange.data.variable.Discrete(x) 
     230                for x in ["a", "b", "c"]] 
     231         >>> d = Orange.data.Domain([a, b, c]) 
     232         >>> print d.features 
     233         <EnumVariable 'a', EnumVariable 'b'> 
     234         >>> print d.class_var 
     235         EnumVariable 'c' 
     236 
     237     :param variables: List of variables (instances of :obj:`Orange.data.variable.Variable`) 
     238     :type variables: list 
     239 
     240     .. method:: __init__(features, class_variable) 
     241 
     242     Construct a domain with the given list of features and the 
     243     class variable. :: 
     244 
     245         >>> d = Orange.data.Domain([a, b], c) 
     246         >>> print d.features 
     247         <EnumVariable 'a', EnumVariable 'b'> 
     248         >>> print d.class_var EnumVariable 'c' 
     249 
     250     :param features: List of features (instances of :obj:`Orange.data.variable.Variable`) 
     251     :type features: list 
     252     :param class_variable: Class variable 
     253     :type features: Orange.data.variable.Variable 
     254 
     255     .. method:: __init__(variables, has_class) 
     256 
     257     Construct a domain with the given variables. If has_class is 
     258     :obj:`True`, the last one is used as the class variable. :: 
     259 
     260         >>> d = Orange.data.Domain([a, b, c], False) 
     261         >>> print d.features 
     262         <EnumVariable 'a', EnumVariable 'b'> 
     263         >>> print d.class_var 
     264         EnumVariable 'c' 
     265 
     266     :param variables: List of variables (instances of :obj:`Orange.data.variable.Variable`) 
     267     :type features: list 
     268     :param has_class: A flag telling whether the domain has a class 
     269     :type has_class: bool 
     270 
     271     .. method:: __init__(variables, source) 
     272 
     273     Construct a domain with the given variables, which can also be 
     274     specified by names, provided that the variables with that 
     275     names exist in the source list. The last variable from the 
     276     list is used as the class variable. :: 
     277 
     278         >>> d1 = orange.Domain([a, b]) 
     279         >>> d2 = orange.Domain(["a", b, c], d1)  
     280 
     281     :param variables: List of variables (strings or instances of :obj:`Orange.data.variable.Variable`) 
     282     :type variables: list 
     283     :param source: An existing domain or a list of variables 
     284     :type source: Orange.data.Domain or list of :obj:`Orange.data.variable.Variable` 
     285 
     286     .. method:: __init__(variables, has_class, source) 
     287 
     288     Similar to above except for the flag which tells whether the 
     289     last variable should be used as the class variable. :: 
     290 
     291         >>> d1 = orange.Domain([a, b]) 
     292         >>> d2 = orange.Domain(["a", b, c], d1)  
     293 
     294     :param variables: List of variables (strings or instances of :obj:`Orange.data.variable.Variable`) 
     295     :type variables: list 
     296     :param has_class: A flag telling whether the domain has a class 
     297     :type has_class: bool 
     298     :param source: An existing domain or a list of variables 
     299     :type source: Orange.data.Domain or list of :obj:`Orange.data.variable.Variable` 
     300 
     301     .. method:: __init__(domain, class_var) 
     302 
     303     Construct a domain as a shallow copy of an existing domain 
     304     except that the class variable is replaced with the given one 
     305     and the class variable of the existing domain becoems an 
     306     ordinary feature. If the new class is one of the original 
     307     domain's features, it can also be specified by a name. 
     308 
     309     :param domain: An existing domain 
     310     :type domain: :obj:`Orange.variable.Domain` 
     311     :param class_var: Class variable for the new domain 
     312     :type class_var: string or :obj:`Orange.data.variable.Variable` 
     313 
     314     .. method:: __init__(domain, has_class=False) 
     315 
     316     Construct a shallow copy of the domain. If the ``has_class`` 
     317     flag is given and equals :obj:`False`, it moves the class 
     318     attribute to ordinary features. 
     319 
     320     :param domain: An existing domain 
     321     :type domain: :obj:`Orange.variable.Domain` 
     322     :param has_class: A flag telling whether the domain has a class 
     323     :type has_class: bool 
     324 
     325     .. method:: has_discrete_attributes(include_class=True) 
     326 
     327     Return :obj:`True` if the domain has any discrete variables; 
     328     class is considered unless ``include_class`` is ``False``. 
     329 
     330     :param has_class: Tells whether to consider the class variable 
     331     :type has_class: bool 
     332     :rtype: bool 
     333 
     334     .. method:: has_continuous_attributes(include_class=True) 
     335 
     336     Return :obj:`True` if the domain has any continuous variables; 
     337     class is considered unless ``include_class`` is ``False``. 
     338 
     339     :param has_class: Tells whether to consider the class variable 
     340     :type has_class: bool 
     341     :rtype: bool 
     342 
     343     .. method:: has_other_attributes(include_class=True) 
     344 
     345     Return :obj:`True` if the domain has any variables which are 
     346     neither discrete nor continuous, such as, for instance string variables. 
     347     class is considered unless ``include_class`` is ``False``. 
     348 
     349     :param has_class: Tells whether to consider the class variable 
     350     :type has_class: bool 
     351     :rtype: bool 
     352 
     353 
     354     .. method:: add_meta(id, variable, optional=0) 
     355 
     356     Register a meta attribute with the given id (obtained by 
     357     :obj:`Orange.data.new_meta_id`). The same meta attribute can (and 
     358     should) have the same id when registered in different domains. :: 
     359 
     360         >>> newid = Orange.data.new_meta_id() 
     361         >>> d2.add_meta(newid, Orange.data.variable.String("name")) 
     362         >>> d2[55]["name"] = "Joe" 
     363         >>> print data2[55] 
     364         ['1', '2', '4', '0'], {"c":'1', "d":'1', "f":'2', "X":'?', "name":'Joe'} 
     365 
     366     The third argument tells whether the meta attribute is optional or 
     367     not. The parameter is an integer, with any non-zero value meaning that 
     368     the attribute is optional. Different values can be used to distinguish 
     369     between various optional attributes; the meaning of the value is not 
     370     defined in advance and can be used arbitrarily by the application. 
     371 
     372     :param id: id of the new meta attribute 
     373     :type id: int 
     374     :param variable: variable descriptor 
     375     :type variable: Orange.data.variable.Variable 
     376     :param optional: tells whether the meta attribute is optional 
     377     :type optional: int 
     378 
     379     .. method:: add_metas(attributes, optional=0) 
     380 
     381     Add multiple meta attributes at once. The dictionary contains id's as 
     382     keys and variables as the corresponding values. The following example 
     383     shows how to add all meta attributes from one domain to another:: 
     384 
     385          newdomain.add_metas(domain.get_metas) 
     386 
     387     The optional second argument has the same meaning as in :obj:`add_meta`. 
     388 
     389     :param attributes: dictionary of id's and variables 
     390     :type attributes: dict 
     391     :param optional: tells whether the meta attribute is optional 
     392     :type optional: int 
     393 
     394     .. method:: remove_meta(attribute) 
     395 
     396     Removes one or multiple meta attributes. Removing a meta attribute has 
     397     no effect on data instances. 
     398 
     399     :param attribute: attribute(s) to be removed, given as name, id, variable descriptor or a list of them 
     400     :type attribute: string, int, Orange.data.variable.Variable; or a list 
     401 
     402     .. method:: has_attribute(attribute) 
     403 
     404     Return True if the domain contains the specified meta attribute. 
     405 
     406     :param attribute: attribute to be checked 
     407     :type attribute: string, int, Orange.data.variable.Variable 
     408     :rtype: bool 
     409 
     410     .. method:: meta_id(attribute) 
     411 
     412     Return an id of a meta attribute. 
     413 
     414     :param attribute: name or variable descriptor of the attribute 
     415     :type attribute: string or Orange.data.variable.Variable 
     416     :rtype: int 
     417 
     418     .. method:: get_meta(attribute) 
     419 
     420     Return a variable descriptor corresponding to the meta attribute. 
     421 
     422     :param attribute: name or id of the attribute 
     423     :type attribute: string or int 
     424     :rtype: Orange.data.variable.Variable 
     425 
     426     .. method:: get_metas() 
     427 
     428      Return a dictionary with meta attribute id's as keys and corresponding 
     429      variable descriptors as values. 
     430 
     431     .. method:: get_metas(optional) 
     432 
     433      Return a dictionary with meta attribute id's as keys and corresponding 
     434      variable descriptors as values; the dictionary contains only meta 
     435      attributes for which the argument ``optional`` matches the flag given 
     436      when the attributes were added using :obj:`add_meta` or :obj:`add_metas`. 
     437 
     438      :param optional: flag that specifies the attributes to be returned 
     439      :type optional: int 
     440      :rtype: dict 
     441 
     442     .. method:: is_optional_meta(attribute) 
     443 
     444     Return True if the given meta attribute is optional, and False if it is 
     445     not. 
     446 
     447     :param attribute: attribute to be checked 
     448     :type attribute: string, int, Orange.data.variable.Variable 
     449     :rtype: bool 
  • orange/doc/Orange/rst/Orange.data.rst

    r7304 r7686  
    1 =========== 
    2 Orange.data 
    3 =========== 
     1================ 
     2Data description 
     3================ 
    44 
    5 .. automodule:: Orange.data 
     5.. toctree:: 
     6 
     7    orange.data.feature 
     8    Orange.data.domain 
  • orange/doc/Orange/rst/index.rst

    r7659 r7686  
    1111   :maxdepth: 3 
    1212 
    13    orange.data.feature 
     13   Orange.data 
     14 
    1415   Orange.associate    
    1516 
    1617   Orange.clustering 
    17     
    18    Orange.data 
    1918    
    2019   Orange.classification 
  • orange/doc/Orange/rst/orange.data.feature.rst

    r7661 r7686  
    1 ==================== 
    2 Orange.data.variable 
    3 ==================== 
     1========= 
     2Variables 
     3========= 
    44 
    55.. automodule:: Orange.data.variable 
Note: See TracChangeset for help on using the changeset viewer.