Changeset 7400:72d2a48f0694 in orange


Ignore:
Timestamp:
02/04/11 10:39:22 (3 years ago)
Author:
tomazc <tomaz.curk@…>
Branch:
default
Convert:
57125163fb4942175ac91c88fe934cc613b2247e
Message:

Documentatio and code refactoring at Bohinj retreat.

File:
1 edited

Legend:

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

    r7395 r7400  
    2424 
    2525        discretizer = Orange.feature.dicretization.EntropyDiscretization() 
    26         disc_data = discretizer(data) 
    27         another_disc_data = Orange.feature.dicretization.EntropyDiscretization(data) 
     26        disc_data = discretizer(table) 
     27        another_disc_data = Orange.feature.dicretization.EntropyDiscretization(table) 
    2828 
    29 .. class:: DiscretizedLearner([baseLearner[, examples[, discretizer[, name]]]]) 
     29.. class:: DiscretizedLearner([baseLearner[, table[, discretizer[, name]]]]) 
    3030 
    31     :param baseLearner: 
     31    This class allows to set an learner object, such that before learning a 
     32    data passed to a learner is discretized. In this way we can prepare an  
     33    object that lears without giving it the data, and, for instance, use it in 
     34    some standard testing procedure that repeats learning/testing on several 
     35    data samples.  
     36 
     37    :param baseLearner: learner to which give discretized data 
     38    :type baseLearner: Orange.classification.Learner 
    3239     
    33     :param instances: 
     40    :param table: data whose continuous features need to be discretized 
     41    :type table: Orange.data.Table 
    3442     
    35     :param discretizer: 
     43    :param discretizer: a discretizer that converts. Defaults to  
     44      :obj:`Orange.feature.discretization.EntropyDiscretization. 
     45    :type discretizer: Orange.feature.discretization.Discretization 
    3646     
    37     :param name: 
     47    :param name: name to assign to learner  
     48    :type name: string 
    3849 
    39 <dt>DiscretizedLearner</dt> 
    40 <index name="classes/DiscretizedLearner (in orngDisc)"> 
    41 <index name="classifiers/with discretization"> 
     50    An example on how such learner is set and used in ten-fold cross validation 
     51    is given below:: 
    4252 
    43 This class allows to set an learner object, such that before learning a data  
    44 passed to a learner is discretized. In this way we can 
    45 prepare an object that lears without giving it the data, and, for 
    46 instance, use it in some standard testing procedure that repeats 
    47 learning/testing on several data samples. Default procedure for 
    48 discretization (<em>discretizer</em>) is 
    49 <code>orngDisc.EntropyDiscretization</code>.  An example on how such 
    50 learner is set and used in ten-fold cross validation is given 
    51 below:: 
    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  
     53        bayes = Orange.classification.bayes.NaiveBayesLearner() 
     54        disc = orange.Preprocessor_discretize(method=Orange.feature.discretization.EquiNDiscretization(numberOfIntervals=10)) 
     55        dBayes = Orange.feature.discretization.DiscretizedLearner(bayes, name='disc bayes') 
     56        dbayes2 = Orange.feature.discretization.DiscretizedLearner(bayes, name="EquiNBayes", discretizer=disc) 
     57        results = Orange.evaluation.testing.CrossValidation([dBayes], table) 
     58        classifier = Orange.feature.discretization.DiscretizedLearner(bayes, examples=table) 
    6059 
    6160======== 
     
    6968 
    7069 
     70.. note:: 
     71    add from reference http://orange.biolab.si/doc/reference/discretization.htm 
    7172 
    7273========== 
     
    7576 
    7677* 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 
     78  attributes for classification learning. In Proceedings of the 13th 
     79  International Joint Conference on Artificial Intelligence, pages 
    7980  1022--1029, Chambery, France, 1993. 
    8081 
Note: See TracChangeset for help on using the changeset viewer.