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

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

Tests moved and renamed from orange 20.

Line 
1# Description: Shows the limitations of contingencies with continuous outer attributes
2# Category:    statistics
3# Classes:     Contingency
4# Uses:        iris
5# Referenced:  contingency.htm
6
7import orange
8data = orange.ExampleTable("iris")
9cont = orange.ContingencyAttrClass(0, data)
10
11print "Contingency items:"
12for val, dist in cont.items()[:5]:
13    print val, dist
14print
15
16print "Contingency keys: ", cont.keys()[:3]
17print "Contingency values: ", cont.values()[:3]
18print "Contingency items: ", cont.items()[:3]
19print
20
21try:
22    midkey = (cont.keys()[0] + cont.keys()[1])/2.0
23    print "cont[%5.3f] =" % (midkey, cont[midkey])
24except Exception, v:
25    print "Error: ", v
Note: See TracBrowser for help on using the repository browser.