source: orange/docs/reference/rst/code/knnInstanceDistance.py @ 9946:96ed77f7d97f

Revision 9946:96ed77f7d97f, 327 bytes checked in by markotoplak, 2 years ago (diff)

Updated examples (remove Orange.core).

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