source: orange/docs/reference/rst/code/statistics-contingency2.py @ 9823:7f9c3f3c6474

Revision 9823:7f9c3f3c6474, 346 bytes checked in by lanumek, 2 years ago (diff)

Changed names of data sets (table replaced with data or name of the data set).

Line 
1import Orange
2
3monks = Orange.data.Table("monks-1.tab")
4cont = Orange.statistics.contingency.Table(monks.domain["e"], monks.domain.classVar)
5for ins in monks:
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 monks:
15    cont.add(ins["e"], ins.get_class())
Note: See TracBrowser for help on using the repository browser.