source: orange/docs/reference/rst/code/scoring-info-iris.py @ 9372:aef193695ea9

Revision 9372:aef193695ea9, 805 bytes checked in by mitar, 2 years ago (diff)

Moved documentation to the separate directory.

Line 
1# Description: Shows how to assess the quality of features not in the dataset
2# Category:    feature scoring
3# Uses:        iris
4# Referenced:  Orange.feature.html#scoring
5# Classes:     Orange.feature.discretization.EntropyDiscretization, Orange.feature.scoring.Measure, Orange.feature.scoring.InfoGain, Orange.feature.scoring.Relief
6
7import Orange
8table = Orange.data.Table("iris")
9
10d1 = Orange.feature.discretization.EntropyDiscretization("petal length", table)
11print Orange.feature.scoring.InfoGain(d1, table)
12
13table = Orange.data.Table("iris")
14meas = Orange.feature.scoring.Relief()
15for t in meas.threshold_function("petal length", table):
16    print "%5.3f: %5.3f" % t
17
18thresh, score, distr = meas.best_threshold("petal length", table)
19print "\nBest threshold: %5.3f (score %5.3f)" % (thresh, score)
Note: See TracBrowser for help on using the repository browser.