source: orange/orange/doc/reference/contingency6.py @ 526:fe2d65da2b2a

Revision 526:fe2d65da2b2a, 671 bytes checked in by janezd <janez.demsar@…>, 10 years ago (diff)
  • moved documentation from a separate module to this one
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.