source: orange/Orange/testing/regression/tests_20/reference_random_classifier.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 435 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

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.