source: orange/docs/reference/rst/code/random_classifier.py @ 9754:060889552ecf

Revision 9754:060889552ecf, 245 bytes checked in by gregorr, 2 years ago (diff)

Added new documentation: Orange.classification.random and Orange.preprocess.RemoveUnusedValues.

Line 
1import Orange
2
3data = Orange.data.Table("lenses")
4
5rc = Orange.classification.RandomClassifier()
6rc.classVar = data.domain.classVar
7rc.probabilities = [0.5, 0.3, 0.2]
8
9for i in range(3):
10    for ex in data[:5]:
11        print ex, rc(ex)
12    print
Note: See TracBrowser for help on using the repository browser.