source: orange/Orange/doc/modules/correspondance.py @ 9671:a7b056375472

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

Moved orange to Orange (part 2)

Line 
1# Description: Demonstrates the use of correspondence analysis
2# Category:    correspondence, projection
3# Classes:     CA
4# Uses:        bridges.tab
5
6import orange
7import orngCA
8
9data = orange.ExampleTable("bridges")
10cm = orange.ContingencyAttrAttr("PURPOSE", "MATERIAL", data)
11ca = orngCA.CA([list(col) for col in cm])
12
13def report(coors, labels):
14    for coor, label in zip(coors, labels):
15        print %-10s (%.3f, %.3f)" % (label + ":", coor[0], coor[1])
16       
17print "PURPOSE"
18report(ca.getPrincipalColProfilesCoordinates(), data.domain["PURPOSE"].values)
19print 
20
21print "MATERIAL"
22report(ca.getPrincipalRowProfilesCoordinates(), data.domain["PURPOSE"].values)
23print 
Note: See TracBrowser for help on using the repository browser.