source: orange/Orange/testing/regression/tests_20/modules_fss5.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 707 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

Line 
1# Description: Recursively eliminates attributes using Relief measure, until
2#              the estimate relevants of all attributes is beyond certain threshold.
3#              Makes use of filterRelieff from orngFSS
4# Category:    preprocessing
5# Uses:        voting.tab
6# Referenced:  orngFSS.htm
7
8import orange, orngFSS
9
10def report_relevance(data):
11  m = orngFSS.attMeasure(data)
12  for i in m:
13    print "%5.3f %s" % (i[1], i[0])
14
15data = orange.ExampleTable("../datasets/adult_sample")
16print "Before feature subset selection:"; report_relevance(data)
17
18marg = 0.01
19ndata = orngFSS.filterRelieff(data, margin=marg)
20print "\nAfter feature subset selection with margin %5.3f:" % marg
21report_relevance(ndata)
Note: See TracBrowser for help on using the repository browser.