source: orange/docs/reference/rst/code/knnExample2.py @ 9724:318e91106d47

Revision 9724:318e91106d47, 273 bytes checked in by markotoplak, 2 years ago (diff)

Renames in Orange.distance.

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