source: orange/docs/reference/rst/code/statistics-contingency2.py @ 9372:aef193695ea9

Revision 9372:aef193695ea9, 346 bytes checked in by mitar, 2 years ago (diff)

Moved documentation to the separate directory.

Line 
1import Orange
2
3table = Orange.data.Table("monks-1.tab")
4cont = Orange.statistics.contingency.Table(table.domain["e"], table.domain.classVar)
5for ins in table:
6    cont [ins["e"]] [ins.get_class()] += 1
7
8print "Contingency items:"
9
10for val, dist in cont.items():
11    print val, dist
12print
13
14for ins in table:
15    cont.add(ins["e"], ins.get_class())
Note: See TracBrowser for help on using the repository browser.