source: orange/docs/reference/rst/code/scoring-info-iris.py @ 9823:7f9c3f3c6474

Revision 9823:7f9c3f3c6474, 799 bytes checked in by lanumek, 2 years ago (diff)

Changed names of data sets (table replaced with data or name of the data set).

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
8iris = Orange.data.Table("iris")
9
10d1 = Orange.feature.discretization.EntropyDiscretization("petal length", iris)
11print Orange.feature.scoring.InfoGain(d1, iris)
12
13iris = Orange.data.Table("iris")
14meas = Orange.feature.scoring.Relief()
15for t in meas.threshold_function("petal length", iris):
16    print "%5.3f: %5.3f" % t
17
18thresh, score, distr = meas.best_threshold("petal length", iris)
19print "\nBest threshold: %5.3f (score %5.3f)" % (thresh, score)
Note: See TracBrowser for help on using the repository browser.