Ignore:
Timestamp:
02/06/12 16:10:03 (2 years ago)
Author:
gregorr
Branch:
default
rebase_source:
80c09a323ffe4dcd6132695d146098703581a0c4
Message:

Added new documentation: Orange.classification.random and Orange.preprocess.RemoveUnusedValues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/preprocess/__init__.py

    r9671 r9754  
    2525 
    2626.. autoclass:: Preprocessor_preprocessorList 
     27 
     28.. class:: RemoveUnusedValues(variable, data, remove_one_valued=False) 
     29 
     30    Often the definition of a discrete attribute declares values that 
     31    do not actually appear in the data, either originally or as a 
     32    consequence of some preprocessing. Such anomalies are taken 
     33    care of by class RemoveUnusedValues that, given an attribute and the 
     34    data, determines whether there are any unused values and reduces the 
     35    attribute if needed. 
     36 
     37    :param variable: :class:`Orange.data.variable.Variable` 
     38    :param data: :class:`Orange.data.Table` 
     39    :param remove_one_valued: Decides whether to remove or to retain 
     40        the attributes with only one value defined (default: False). 
     41     
     42    Example: 
     43     
     44    .. literalinclude:: code/unusedValues.py     
     45 
     46    There are four possible outcomes: 
     47     
     48    1. The variable does not have any used values in the data - value 
     49    of this variable is undefined for all examples. The variable is 
     50    thus useless and the class returns None. 
     51 
     52    2. The variable has only one used value (or, possibly, only one 
     53    value at all). Such a variable is in fact useless, and can 
     54    probably be removed without harm. Nevertheless, its fate is 
     55    decided by the flag remove_one_valued which is False by default, 
     56    so such variables are retained unless explicitly specified 
     57    otherwise. 
     58 
     59    3. All variable's values occur in the data (and the variable has more 
     60    than one value; otherwise the above case applies). The original variable 
     61    is returned. 
     62 
     63    4. There are some unused values. A new variable is constructed and the 
     64    unused values are omitted. The value of the new variable is computed 
     65    automatically from the value of the original variable  
     66    :class:`Orange.classification.lookup.ClassifierByLookupTable` is used 
     67    for mapping. 
     68     
     69    Results of example: 
     70     
     71    .. literalinclude:: code/unusedValues.res 
     72     
     73    Variables a and y are OK and are left alone. In b, value 1 is not used 
     74    and is removed (not in the original variable, of course; a new variable 
     75    is created). c is useless and is removed altogether. d is retained since 
     76    remove_one_valued was left at False; if we set it to True, this variable 
     77    would be removed as well. 
    2778 
    2879""" 
Note: See TracChangeset for help on using the changeset viewer.