source: orange/orange/doc/modules/PCA1.py @ 6252:c67310ac6363

Revision 6252:c67310ac6363, 664 bytes checked in by nejc <nejc@…>, 5 years ago (diff)
Line 
1# Description: PCA with attribute and row selection
2# Category:    projection
3# Uses:        iris
4# Referenced:  orngPCA.htm
5# Classes:     orngPCA.PCA
6
7import orange, orngPCA
8
9data = orange.ExampleTable("iris.tab")
10
11pca = orngPCA.PCA(data, standardize = True)
12print "PCA on all data:"
13print pca
14
15attributes = ['sepal length', 'sepal width', 'petal length', 'petal width']
16pca = orngPCA.PCA(data, standardize = True, attributes = attributes)
17print "PCA on attributes sepal.length, sepal.width, petal.length, petal.width:"
18print pca
19
20rows = [1, 0] * (len(data) / 2)
21pca = orngPCA.PCA(data, standardize = True, rows = rows)
22print "PCA on every second row:"
23print pca
Note: See TracBrowser for help on using the repository browser.