Changeset 8169:c9a8b9e448aa in orange
 Timestamp:
 08/16/11 11:12:07 (3 years ago)
 Branch:
 default
 Convert:
 a65f82cfe15a839bb7a7c5f7be29ea059a5989dd
 Location:
 orange
 Files:

 3 added
 2 edited
Legend:
 Unmodified
 Added
 Removed

orange/Orange/projection/pca.py
r8072 r8169 11 11 principal components. This transformation is defined in such a way that the 12 12 first variable has as high variance as possible. 13 13 14 14 If data instances are provided to the constructor, the learning algorithm 15 15 is called and the resulting classifier is returned instead of the learner. … … 43 43 def __call__(self, dataset): 44 44 """ 45 Perform a pca analysis on a dataset and return classifer that maps data45 Perform a pca analysis on a dataset and return a classifer that maps data 46 46 into principal component subspace. 47 47 """ … … 188 188 # for i, a in enumerate(self.input_domain.attributes) 189 189 # ]) 190 ]) if len(self.pc_domain) <= 16else \190 ]) if len(self.pc_domain) <= ncomponents else \ 191 191 "\n".join([ 192 192 "PCA SUMMARY", 
orange/doc/Orange/rst/Orange.projection.pca.rst
r8040 r8169 8 8 ************************************* 9 9 10 An implementation of `principal component analysis <http://en.wikipedia.org/wiki/Principal_component_analysis>`_. 11 PCA uses an orthogonal transformation to transform input features into a set of uncorrelated features called principal 12 components. This transformation is defined in such a way that the first principal component has as high variance as 13 possible and each succeeding component in turn has the highest variance possible under constraint that is be orthogonal 14 to the preceding components. 15 16 Because PCA is sensitive to the relative scaling of the original variables the default behaviour of PCA class is to 17 standardize the input data. 18 19 Learner and Classifier 20 ====================== 21 10 22 .. index:: PCA 11 23 .. autoclass:: Orange.projection.pca.Pca … … 14 26 .. autoclass:: Orange.projection.pca.PcaClassifier 15 27 :members: 28 29 Examples 30 ======== 31 32 The following example demonstrates a straightforward invocation of PCA 33 (`pcarun.py`_, uses `iris.tab`_): 34 35 .. literalinclude:: code/pcarun.py 36 :lines: 7 37 38 The call to the Pca constructor returns an instance of PcaClassifier, which is later used to transform data to PCA 39 feature space. Printing the classifier displays how much variance is covered with the first few components. Classifier 40 can also be used to access transformation vectors (eigen_vectors) and variance of the pca components (eigen_values). 41 Scree plot can be used when deciding, how many components to keep (`pcascree.py`_, uses `iris.tab`_): 42 43 .. literalinclude:: code/pcascree.py 44 :lines: 7 45 46 .. image:: code/pcascree.png 47 :scale: 50 % 48 49 50 .. _pcarun.py: code/pcarun.py 51 .. _iris.tab: code/iris.tab
Note: See TracChangeset
for help on using the changeset viewer.