source: orange/Orange/testing/regression/tests_20/modules_correspondance.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 677 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

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.