source: orange/docs/reference/rst/code/knnInstanceDistance.py @ 9372:aef193695ea9

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

Moved documentation to the separate directory.

Line 
1import Orange
2
3table = Orange.data.Table("lenses")
4
5nnc = Orange.classification.knn.FindNearestConstructor()
6nnc.distanceConstructor = Orange.core.ExamplesDistanceConstructor_Euclidean()
7
8did = Orange.core.newmetaid()
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.