source: orange/docs/reference/rst/code/discretization-entropy.py @ 9943:364085431ea7

Revision 9943:364085431ea7, 482 bytes checked in by blaz <blaz.zupan@…>, 2 years ago (diff)

updates for discretization rst

Line 
1import Orange
2
3data = Orange.data.Table(Orange.data.Table("heart_disease.tab")[:100])
4d_data = Orange.data.discretization.DiscretizeTable(data,
5    method=Orange.feature.discretization.Entropy(forced=False))
6
7old = set(data.domain.features)
8new = set(x.get_value_from.variable if x.get_value_from else x for x in d_data.domain.features)
9diff = old.difference(new)
10print "Redundant features (%d of %d):" % (len(diff), len(data.domain.features))
11print ", ".join(x.name for x in diff)
Note: See TracBrowser for help on using the repository browser.