source: orange/docs/reference/rst/code/ @ 9638:eb3af38491f2

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

Changed table to data or name of the data set.

For example - instead of

table ="housing")

is changed to

housing ="housing")

1import Orange
2iris ="iris")
4knn = Orange.classification.knn.kNNLearner()
5knn.k = 10
6knn.distance_constructor = Orange.core.ExamplesDistanceConstructor_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.