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

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

Moved documentation to the separate directory.

Line 
1import Orange
2table = Orange.data.Table("iris")
3
4knn = Orange.classification.knn.kNNLearner()
5knn.k = 10
6knn.distance_constructor = 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.