source: orange/orange/doc/reference/pp-discretization.py @ 526:fe2d65da2b2a

Revision 526:fe2d65da2b2a, 568 bytes checked in by janezd <janez.demsar@…>, 10 years ago (diff)
  • moved documentation from a separate module to this one
Line 
1# Description: Shows how to use preprocessors for discretization
2# Category:    preprocessing, discretization, categorization
3# Classes:     Preprocessor, Preprocessor_discretize
4# Uses:        iris
5# Referenced:  preprocessing.htm
6
7import orange
8iris = orange.ExampleTable("iris")
9
10pp = orange.Preprocessor_discretize()
11pp.method = orange.EquiDistDiscretization(numberOfIntervals = 5)
12data2 = pp(iris)
13
14for ex in data2[:10]:
15    print ex
16
17pp.attributes = [iris.domain["petal length"], iris.domain["sepal length"]]
18data2 = pp(iris)
19
20for ex in data2[:10]:
21    print ex
Note: See TracBrowser for help on using the repository browser.