Changeset 7395:1e7b305065f8 in orange


Ignore:
Timestamp:
02/04/11 10:17:54 (3 years ago)
Author:
tomazc <tomaz.curk@…>
Branch:
default
Convert:
a91aa565248f989ffc3f7f4b980ad10f57482865
Message:

Documentatio and code refactoring at Bohinj retreat.

Location:
orange/Orange/feature
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/feature/discretization.py

    r7290 r7395  
     1""" 
     2 
     3This module implements some functions and classes that can be used for 
     4categorization of continuous features. Besides several general classes that 
     5can help in this task, we also provide a function that may help in 
     6entropy-based discretization (Fayyad & Irani), and a wrapper around classes for 
     7categorization that can be used for learning. 
     8 
     9.. method:: entropyDiscretization(table) 
     10 
     11    Take the classified data set (table) and categorize all continuous 
     12    features using the entropy based discretization  
     13    :obj:`EntropyDiscretization`. After categorization,  
     14    features that were categorized to a single interval (to a constant value)  
     15    are removed from table. Returns the data set that includes all categorical 
     16    and discretized continuous features from the original data table. 
     17 
     18.. class:: EntropyDiscretization 
     19 
     20    This is simple wrapper class around the function 
     21    :obj:`entropyDiscretization`. Once invoked it would either create an 
     22    object that can be passed a data set for discretization, or if invoked 
     23    with the data set, would return a discretized data set:: 
     24 
     25        discretizer = Orange.feature.dicretization.EntropyDiscretization() 
     26        disc_data = discretizer(data) 
     27        another_disc_data = Orange.feature.dicretization.EntropyDiscretization(data) 
     28 
     29.. class:: DiscretizedLearner([baseLearner[, examples[, discretizer[, name]]]]) 
     30 
     31    :param baseLearner: 
     32     
     33    :param instances: 
     34     
     35    :param discretizer: 
     36     
     37    :param name: 
     38 
     39<dt>DiscretizedLearner</dt> 
     40<index name="classes/DiscretizedLearner (in orngDisc)"> 
     41<index name="classifiers/with discretization"> 
     42 
     43This class allows to set an learner object, such that before learning a data  
     44passed to a learner is discretized. In this way we can 
     45prepare an object that lears without giving it the data, and, for 
     46instance, use it in some standard testing procedure that repeats 
     47learning/testing on several data samples. Default procedure for 
     48discretization (<em>discretizer</em>) is 
     49<code>orngDisc.EntropyDiscretization</code>.  An example on how such 
     50learner is set and used in ten-fold cross validation is given 
     51below:: 
     52 
     53    bayes = orange.BayesLearner() 
     54    disc = orange.Preprocessor_discretize(method=orange.EquiNDiscretization(numberOfIntervals=10)) 
     55    dBayes = orngDisc.DiscretizedLearner(bayes, name='disc bayes') 
     56    dbayes2 = orngDisc.DiscretizedLearner(bayes, name="EquiNBayes", discretizer=disc) 
     57    results = orngEval.CrossValidation([dBayes], data) 
     58    classifier = orngDisc.DiscretizedLearner(bayes, examples=data) 
     59 
     60 
     61======== 
     62Examples 
     63======== 
     64 
     65A chapter on `feature subset selection <../ofb/o_fss.htm>`_ in Orange 
     66for Beginners tutorial shows the use of DiscretizedLearner. Other 
     67discretization classes from core Orange are listed in chapter on 
     68`categorization <../ofb/o_categorization.htm>`_ of the same tutorial. 
     69 
     70 
     71 
     72========== 
     73References 
     74========== 
     75 
     76* UM Fayyad and KB Irani. Multi-interval discretization of continuous valued 
     77  attributes for classification learning. In <em>Proceedings of the 13th 
     78  International Joint Conference on Artificial Intelligence</em>, pages 
     79  1022--1029, Chambery, France, 1993. 
     80 
     81""" 
     82 
    183import Orange.core as orange 
    284 
  • orange/Orange/feature/scoring.py

    r7389 r7395  
    183183    "tear_rate", you could write simply:: 
    184184 
    185         >>> print orange.MeasureAttribute_info("tear_rate", data) 
     185        >>> print Orange.feature.scoring.Info("tear_rate", data) 
    186186        0.548794984818 
    187187 
Note: See TracChangeset for help on using the changeset viewer.