Changeset 10228:6ab01f38a958 in orange


Ignore:
Timestamp:
02/15/12 12:02:06 (2 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Message:

Changes in documentation about imputers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/Orange.feature.imputation.rst

    r10099 r10228  
    1010*************************** 
    1111 
    12 Imputation replaces missing feature values with appropriate values, in this 
    13 case with minimal values: 
     12Imputation replaces missing feature values with appropriate values, for instancewith minimal values of features: 
    1413 
    1514.. literalinclude:: code/imputation-values.py 
     
    2726-------- 
    2827 
    29 :obj:`~Orange.feature.imputation.Constructor` is the abstract root in a 
     28:obj:`Orange.feature.imputation.Constructor` is the abstract root of a 
    3029hierarchy of classes that accept training data and construct an instance of 
    31 a class derived from :obj:`~Orange.feature.imputation.Imputer`. When an 
     30a class derived from :obj:`Orange.feature.imputation.Imputer`. When an 
    3231:obj:`~Orange.feature.imputation.Imputer` is called with an 
    3332:obj:`~Orange.data.Instance` it returns a new instance with the 
    3433missing values imputed (leaving the original instance intact). If imputer is 
    3534called with a :obj:`~Orange.data.Table` it returns a new data table with 
    36 imputed instances. 
     35imputed values. 
    3736 
    3837.. class:: Constructor 
     
    4039    .. attribute:: impute_class 
    4140 
    42     Indicates whether to impute the class value. Defaults to True. 
     41        Indicates whether to impute the class value. Defaults to True. 
    4342 
    4443Simple imputation 
    4544================= 
    4645 
    47 Simple imputers always impute the same value for a particular feature, 
    48 disregarding the values of other features. They all use the same class 
    49 :obj:`Defaults`. 
     46Simple imputation always imputes the same value for a particular feature, 
     47disregarding the values of other features. 
    5048 
    5149.. class:: Defaults 
     
    5351    .. attribute::  defaults 
    5452 
    55     An instance :obj:`~Orange.data.Instance` with the default values to be 
    56     imputed instead of missing value. Examples to be imputed must be from the 
    57     same :obj:`~Orange.data.Domain` as 
    58     :obj:`~Orange.feature.imputation.Defaults.defaults`. 
    59  
    60 Instances of this class can be constructed by 
    61 :obj:`~Orange.feature.imputation.MinimalConstructor`, 
     53    A data instance :obj:`~Orange.data.Instance` with the default 
     54    values that are imputed instead of the missing 
     55    values. Features whose values are left unspecified are not 
     56    imputed. The instances to which the data is imputed be from 
     57    the same :obj:`~Orange.data.Domain` as 
     58    :obj:`~Orange.feature.imputation.Defaults.defaults`. 
     59 
     60    .. method:: __init__(domain) 
     61 
     62        Construct a new instance of 
     63        :obj:`~Orange.feature.imputation.Defaults` and set 
     64        :obj:`defaults` to a data instance with from the given domain 
     65        all values undefined. 
     66 
     67        The following example constructs an imputer that sets the 
     68        unknown bridge lengths to 1234 and leaves are all other values 
     69        as they are: 
     70 
     71        .. literalinclude:: code/imputation-complex.py 
     72            :lines: 57-58 
     73 
     74    .. method:: __init__(values) 
     75 
     76        Construct a new instance of the class and set the 
     77        :obj:`defaults` to the given values. The constructor does not 
     78        copy the data instance, so if the instance is not constructed 
     79        specifically for the imputer, the caller should make a copy 
     80        (e.g. by calling 
     81        ``Orange.feature.imputation.Defaults(Orange.data.Instance(inst))`` 
     82        and not ``Orange.feature.imputation.Defaults(inst)``. 
     83 
     84Instances of :obj:`Orange.feature.imputation.Defaults` are returned 
     85by :obj:`~Orange.feature.imputation.MinimalConstructor`, 
    6286:obj:`~Orange.feature.imputation.MaximalConstructor`, 
    6387:obj:`~Orange.feature.imputation.AverageConstructor`. 
     
    7397pessimistic imputations. 
    7498 
    75 User-define defaults can be given when constructing a 
    76 :obj:`~Orange.feature.imputation.Defaults`. Values that are left 
    77 unspecified do not get imputed. In the following example "LENGTH" is the 
    78 only attribute to get imputed with value 1234: 
    79  
    80 .. literalinclude:: code/imputation-complex.py 
    81     :lines: 56-69 
    82  
    83 If :obj:`~Orange.feature.imputation.Defaults`'s constructor is given 
    84 an argument of type :obj:`~Orange.data.Domain` it constructs an empty instance 
    85 for :obj:`~Orange.feature.imputation.Defaults.defaults`. If an 
    86 instance is given, the reference to the instance is kept. To avoid problems 
    87 associated with `Defaults(data[0])`, it is better to provide a copy 
    88 of the instance: `Defaults(Orange.data.Instance(data[0]))`. 
     99 
    89100 
    90101Random imputation 
Note: See TracChangeset for help on using the changeset viewer.