source: orange/Orange/doc/modules/fss6.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 731 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1# Description: Same as fss5.py but uses FilterRelieff class from orngFSS
2# Category:    preprocessing
3# Uses:        adult_saple.tab
4# Referenced:  orngFSS.htm
5
6import orange, orngFSS
7data = orange.ExampleTable("../datasets/adult_sample")
8
9def report_relevance(data):
10  m = orngFSS.attMeasure(data)
11  for i in m:
12    print "%5.3f %s" % (i[1], i[0])
13
14print "Before feature subset selection (%d attributes):" % len(data.domain.attributes)
15report_relevance(data)
16data = orange.ExampleTable("../datasets/adult_sample")
17
18marg = 0.01
19filter = orngFSS.FilterRelief(margin=marg)
20ndata = filter(data)
21print "\nAfter feature subset selection with margin %5.3f (%d attributes):" % (marg, len(ndata.domain.attributes))
22report_relevance(ndata)
Note: See TracBrowser for help on using the repository browser.