source: orange/orange/doc/Orange/rst/code/knnExample2.py @ 7774:34ed6981f73c

Revision 7774:34ed6981f73c, 298 bytes checked in by mocnik <mocnik@…>, 3 years ago (diff)

underscore change in knn.distance_constructor

Line 
1import Orange
2table = Orange.data.Table("iris")
3
4knn = Orange.classification.knn.kNNLearner()
5knn.k = 10
6knn.distance_onstructor = Orange.core.ExamplesDistanceConstructor_Hamming()
7knn = knn(table)
8for i in range(5):
9    instance = table.randomexample()
10    print instance.getclass(), knn(instance)
Note: See TracBrowser for help on using the repository browser.