source: orange/docs/reference/rst/code/discretization-entropy.py @ 10012:4ba1aa91419d

Revision 10012:4ba1aa91419d, 490 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Fixed tests.

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(sorted(x.name for x in diff))
Note: See TracBrowser for help on using the repository browser.