Changeset 7395:1e7b305065f8 in orange

02/04/11 10:17:54 (3 years ago)
tomazc <tomaz.curk@…>

Documentatio and code refactoring at Bohinj retreat.

2 edited


  • orange/Orange/feature/

    r7290 r7395  
     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. 
     9.. method:: entropyDiscretization(table) 
     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. 
     18.. class:: EntropyDiscretization 
     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:: 
     25        discretizer = Orange.feature.dicretization.EntropyDiscretization() 
     26        disc_data = discretizer(data) 
     27        another_disc_data = Orange.feature.dicretization.EntropyDiscretization(data) 
     29.. class:: DiscretizedLearner([baseLearner[, examples[, discretizer[, name]]]]) 
     31    :param baseLearner: 
     33    :param instances: 
     35    :param discretizer: 
     37    :param name: 
     40<index name="classes/DiscretizedLearner (in orngDisc)"> 
     41<index name="classifiers/with discretization"> 
     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 
     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) 
     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. 
     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. 
    183import Orange.core as orange 
  • orange/Orange/feature/

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