source: orange/docs/reference/rst/code/knnInstanceDistance.py @ 9525:4ecaecab0671

Revision 9525:4ecaecab0671, 332 bytes checked in by markotoplak, 2 years ago (diff)

Used the same get_meta_id everywhere.

Line 
1import Orange
2
3table = Orange.data.Table("lenses")
4
5nnc = Orange.classification.knn.FindNearestConstructor()
6nnc.distanceConstructor = Orange.core.ExamplesDistanceConstructor_Euclidean()
7
8did = Orange.data.new_meta_id()
9nn = nnc(table, 0, did)
10
11print "*** Reference instance: ", table[0]
12for inst in nn(table[0], 5):
13    print inst
Note: See TracBrowser for help on using the repository browser.