source: orange/docs/reference/rst/code/scoring-relief-caching.py @ 9945:ba7e22d4ebc5

Revision 9945:ba7e22d4ebc5, 466 bytes checked in by markotoplak, 2 years ago (diff)

Modernized some example scripts.

Line 
1# Description: Shows why ReliefF needs to check the cached neighbours
2# Category:    statistics
3# Classes:     MeasureAttribute_relief
4# Uses:        iris
5# Referenced:  MeasureAttribute.htm
6
7import Orange
8iris = Orange.data.Table("iris")
9
10r1 = Orange.feature.scoring.Relief()
11r2 = Orange.feature.scoring.Relief(check_cached_data = False)
12
13print "%.3f\t%.3f" % (r1(0, iris), r2(0, iris))
14for ex in iris:
15    ex[0] = 0
16print "%.3f\t%.3f" % (r1(0, iris), r2(0, iris))
Note: See TracBrowser for help on using the repository browser.