source: orange/docs/reference/rst/code/knnInstanceDistance.py @ 9638:eb3af38491f2

Revision 9638:eb3af38491f2, 336 bytes checked in by umek@…, 2 years ago (diff)

Changed table to data or name of the data set.

For example - instead of

table = Orange.data.Table("housing")

is changed to

housing = Orange.data.Table("housing")

Line 
1import Orange
2
3lenses = 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(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.