source: orange/Orange/doc/reference/random_classifier.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 435 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1# Description: Shows a classifier that makes random decisions
2# Category:    classification
3# Classes:     RandomClassifier
4# Uses:        lenses
5# Referenced:  RandomClassifier.htm
6
7import orange, orngTest, orngStat
8
9data = orange.ExampleTable("lenses")
10
11rc = orange.RandomClassifier()
12rc.classVar = data.domain.classVar
13rc.probabilities = [0.5, 0.3, 0.2]
14
15for i in range(3):
16    for ex in data[:5]:
17        print ex, rc(ex)
18    print
Note: See TracBrowser for help on using the repository browser.