Changeset 7308:6c42f4172672 in orange


Ignore:
Timestamp:
02/03/11 11:55:01 (3 years ago)
Author:
mocnik <mocnik@…>
Branch:
default
Convert:
41e72285017a3a522d875bf67402f931440cd730
Message:
  • cleaning mistakes
Location:
orange/doc/Orange/rst/code
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orange/doc/Orange/rst/code/knnExample1.py

    r7295 r7308  
    22table = Orange.data.Table("iris") 
    33 
    4 rndind = Orange.core.MakeRandomIndices2(data, p0=0.8) 
     4rndind = Orange.core.MakeRandomIndices2(table, p0=0.8) 
    55train = table.select(rndind, 0) 
    66test = table.select(rndind, 1) 
    77 
    8 knn = Orange.classifier.kNNLearner(train, k=10) 
     8knn = Orange.classification.knn.kNNLearner(train, k=10) 
    99for i in range(5): 
    1010    instance = test.randomexample() 
  • orange/doc/Orange/rst/code/knnExample2.py

    r7305 r7308  
    1 knn = Orange.classification.kNNLearner() 
     1import Orange 
     2table = Orange.data.Table("iris") 
     3 
     4knn = Orange.classification.knn.kNNLearner() 
    25knn.k = 10 
    36knn.distanceConstructor = Orange.core.ExamplesDistanceConstructor_Hamming() 
    4 knn = knn(train) 
     7knn = knn(table) 
    58for i in range(5): 
    6     instance = test.randomexample() 
     9    instance = table.randomexample() 
    710    print instance.getclass(), knn(instance) 
  • orange/doc/Orange/rst/code/knnInstanceDistance.py

    r7295 r7308  
    33table = Orange.data.Table("lenses") 
    44 
    5 nnc = Orange.classifier.knn.FindNearestConstructore() 
     5nnc = Orange.classification.knn.FindNearestConstructor() 
    66nnc.distanceConstructor = Orange.core.ExamplesDistanceConstructor_Euclidean() 
    77 
Note: See TracChangeset for help on using the changeset viewer.