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

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

Moved orange to Orange (part 2)

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.