1 | .. index:: Pricipal Component Analysis |
---|

2 | |
---|

3 | .. index:: |
---|

4 | single: projection, Principal Component Analysis |
---|

5 | |
---|

6 | ************************************* |
---|

7 | Pricipal Component Analysis (``pca``) |
---|

8 | ************************************* |
---|

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 | |
---|

22 | .. index:: PCA |
---|

23 | .. autoclass:: Orange.projection.pca.Pca |
---|

24 | :members: |
---|

25 | |
---|

26 | .. autoclass:: Orange.projection.pca.PcaClassifier |
---|

27 | :members: |
---|

28 | |
---|

29 | Examples |
---|

30 | ======== |
---|

31 | |
---|

32 | The following example demonstrates a straightforward invocation of PCA |
---|

33 | (:download:`pca-run.py <code/pca-run.py>`, uses :download:`iris.tab <code/iris.tab>`): |
---|

34 | |
---|

35 | .. literalinclude:: code/pca-run.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 (:download:`pca-scree.py <code/pca-scree.py>`, |
---|

42 | uses :download:`iris.tab <code/iris.tab>`): |
---|

43 | |
---|

44 | .. literalinclude:: code/pca-scree.py |
---|

45 | :lines: 7- |
---|

46 | |
---|

47 | .. image:: files/pca-scree.png |
---|

48 | :scale: 50 % |
---|