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

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

Updated examples (remove Orange.core).

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.random_example()
10    print instance.getclass(), knn(instance)
Note: See TracBrowser for help on using the repository browser.