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

Revision 526:fe2d65da2b2a, 874 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 (manually) select a subset of attributes
2# Category:    preprocessing, feature subset selection
3# Classes:     Preprocessor, Preprocessor_select, Preprocessor_ignore
4# Uses:        lenses
5# Referenced:  preprocessing.htm
6
7import orange
8data = orange.ExampleTable("lenses")
9age, prescr, astigm, tears, y = data.domain.variables
10
11## Preprocessor_select
12
13print "\n\nPreprocessor_select\n"
14pp = orange.Preprocessor_select()
15pp.attributes = [age, tears]
16
17data2 = pp(data)
18print "Attributes: %s, classVar %s" % (data2.domain.attributes, data2.domain.classVar)
19for i in data2[:5]:
20    print i   
21
22## Preprocessor_ignore
23
24print "\n\nPreprocessor_ignore\n"   
25data2 = orange.Preprocessor_ignore(data, attributes = [age, tears])
26print "Attributes: %s, classVar %s" % (data2.domain.attributes, data2.domain.classVar)
27for i in data2[:5]:
28    print i   
29
30
Note: See TracBrowser for help on using the repository browser.