Changeset 9807:56bf3eae608e in orange


Ignore:
Timestamp:
02/06/12 13:44:31 (2 years ago)
Author:
tomazc <tomaz.curk@…>
Branch:
default
rebase_source:
f3558a745853a391be6cc1013b039890d71849f2
Message:

Orange.feature.imputation

File:
1 edited

Legend:

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

    r9806 r9807  
    2828 
    2929:obj:`ImputerConstructor` is the abstract root in the hierarchy of classes 
    30 that get training data and construct an instance of a class derived from 
     30that accept training data and construct an instance of a class derived from 
    3131:obj:`Imputer`. When an :obj:`Imputer` is called with an 
    32 :obj:`Orange.data.Instance` it will return a new example with the 
     32:obj:`Orange.data.Instance` it returns a new example with the 
    3333missing values imputed (leaving the original example intact). If imputer is 
    34 called with an :obj:`Orange.data.Table` it will return a new example table 
     34called with an :obj:`Orange.data.Table` it returns a new example table 
    3535with imputed instances. 
    3636 
     
    5757 
    5858    An instance :obj:`Orange.data.Instance` with the default values to be 
    59     imputed instead of missing. Examples to be imputed must be from the same 
    60     domain as :obj:`defaults`. 
     59    imputed instead of missing value. Examples to be imputed must be from the 
     60    same :obj:`~Orange.data.Domain` as :obj:`defaults`. 
    6161 
    6262Instances of this class can be constructed by 
    63 :obj:`Orange.feature.imputation.ImputerConstructor_minimal`, 
    64 :obj:`Orange.feature.imputation.ImputerConstructor_maximal`, 
    65 :obj:`Orange.feature.imputation.ImputerConstructor_average`. 
    66  
    67 For continuous features, they will impute the smallest, 
    68 largest or the average values encountered in the training examples. 
    69  
    70 For discrete, they will impute the lowest (the one with index 0, 
    71 e. g. attr.values[0]), the highest (attr.values[-1]), 
    72 and the most common value encountered in the data. 
    73  
    74 The first two imputers 
    75 will mostly be used when the discrete values are ordered according to their 
    76 impact on the class (for instance, possible values for symptoms of some 
    77 disease can be ordered according to their seriousness). The minimal and maximal 
    78 imputers will then represent optimistic and pessimistic imputations. 
    79  
    80 The following code will load the bridges data, and first impute the values 
    81 in a single examples and then in the whole table. 
    82  
    83 :download:`imputation-complex.py <code/imputation-complex.py>` (uses :download:`bridges.tab <code/bridges.tab>`): 
    84  
    85 .. literalinclude:: code/imputation-complex.py 
    86     :lines: 9-23 
    87  
    88 This is example shows what the imputer does, not how it is to be used. Don't 
    89 impute all the data and then use it for cross-validation. As warned at the top 
    90 of this page, see the instructions for actual `use of 
    91 imputers <#using-imputers>`_. 
    92  
    93 .. note:: The :obj:`ImputerConstructor` are another class with schizophrenic 
    94   constructor: if you give the constructor the data, it will return an \ 
    95   :obj:`Imputer` - the above call is equivalent to calling \ 
    96   :obj:`Orange.feature.imputation.ImputerConstructor_minimal()(data)`. 
    97  
    98 You can also construct the :obj:`Orange.feature.imputation.Imputer_defaults` 
     63:obj:`~Orange.feature.imputation.ImputerConstructor_minimal`, 
     64:obj:`~Orange.feature.imputation.ImputerConstructor_maximal`, 
     65:obj:`~Orange.feature.imputation.ImputerConstructor_average`. 
     66 
     67For continuous features, they will impute the smallest, largest or the average 
     68values encountered in the training examples. For discrete, 
     69they will impute the lowest (the one with index 0, e. g. attr.values[0]), 
     70the highest (attr.values[-1]), and the most common value encountered in the 
     71data. 
     72 
     73If values of discrete features are be ordered according to their 
     74impact on class (for example, possible values for symptoms of some 
     75disease can be ordered according to their seriousness), 
     76the minimal and maximal imputers will then represent optimistic and 
     77pessimistic imputations. 
     78 
     79To construct the :obj:`~Orange.feature.imputation.Imputer_defaults` 
    9980yourself and specify your own defaults. Or leave some values unspecified, in 
    10081which case the imputer won't impute them, as in the following example. Here, 
Note: See TracChangeset for help on using the changeset viewer.