1 / 39

Principal Components Analysis (PCA)

Principal Components Analysis (PCA). Principal Components Analysis (PCA). a technique for finding patterns in data of high dimension. Outline: Eigenvectors and eigenvalues PCA: Getting the data Centering the data Obtaining the covariance matrix

barr
Download Presentation

Principal Components Analysis (PCA)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Principal Components Analysis (PCA)

  2. Principal Components Analysis (PCA) a technique for finding patterns in data of high dimension

  3. Outline: • Eigenvectors and eigenvalues • PCA: • Getting the data • Centering the data • Obtaining the covariance matrix • Performing an eigenvalue decomposition of the covariance matrix • Choosing components and forming a feature vector • Deriving the new data set

  4. Outline: • Eigenvectors and eigenvalues • PCA: • Getting the data • Centering the data • Obtaining the covariance matrix • Performing an eigenvalue decomposition of the covariance matrix • Choosing components and forming a feature vector • Deriving the new data set

  5. Eigenvectors & eigenvalues:

  6. Eigenvectors & eigenvalues: *

  7. Eigenvectors & eigenvalues: * =

  8. Eigenvectors & eigenvalues: * = *

  9. Eigenvectors & eigenvalues: * = * =

  10. Eigenvectors & eigenvalues: * = * = = 4 *

  11. Eigenvectors & eigenvalues: * = * = = 4 *

  12. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 *

  13. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it)

  14. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) 8 2 (3,2) 3 12

  15. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) 8 (12,8) 2 (3,2) 3 12

  16. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: 8 (12,8) 2 (3,2) 3 12

  17. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: eigenvectors can only be found for square matrices 8 (12,8) 2 (3,2) 3 12

  18. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: eigenvectors can only be found for square matrices not every square matrix has eigenvectors 8 (12,8) 2 (3,2) 3 12

  19. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: eigenvectors can only be found for square matrices not every square matrix has eigenvectors given that an n x n matrix has eigenvectors, there are n of them 8 (12,8) 2 (3,2) 3 12

  20. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: eigenvectors can only be found for square matrices not every square matrix has eigenvectors given that an n x n matrix has eigenvectors, there are n of them the eigenvectors of a matrix are orthogonal, i.e. at right angles to each other 8 (12,8) 2 (3,2) 3 12

  21. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: eigenvectors can only be found for square matrices not every square matrix has eigenvectors given that an n x n matrix has eigenvectors, there are n of them the eigenvectors of a matrix are orthogonal, i.e. at right angles to each other if an eigenvector is scaled by some amount before multiplying the matrix by it, the result is still the same multiple (because scaling a vector only changes its length, not its direction) 8 (12,8) 2 (3,2) 3 12

  22. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: eigenvectors can only be found for square matrices not every square matrix has eigenvectors given that an n x n matrix has eigenvectors, there are n of them the eigenvectors of a matrix are orthogonal, i.e. at right angles to each other if an eigenvector is scaled by some amount before multiplying the matrix by it, the result is still the same multiple (because scaling a vector only changes its length, not its direction) 8 (12,8) 2 (3,2) 3 12

  23. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: eigenvectors can only be found for square matrices not every square matrix has eigenvectors given that an n x n matrix has eigenvectors, there are n of them the eigenvectors of a matrix are orthogonal, i.e. at right angles to each other if an eigenvector is scaled by some amount before multiplying the matrix by it, the result is still the same multiple (because scaling a vector only changes its length, not its direction) 8 (12,8) 2 (3,2) 3 12

  24. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: eigenvectors can only be found for square matrices not every square matrix has eigenvectors given that an n x n matrix has eigenvectors, there are n of them the eigenvectors of a matrix are orthogonal, i.e. at right angles to each other if an eigenvector is scaled by some amount before multiplying the matrix by it, the result is still the same multiple (because scaling a vector only changes its length, not its direction) 8 (12,8) 2 (3,2) 3 12

  25. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: eigenvectors can only be found for square matrices not every square matrix has eigenvectors given that an n x n matrix has eigenvectors, there are n of them the eigenvectors of a matrix are orthogonal, i.e. at right angles to each other if an eigenvector is scaled by some amount before multiplying the matrix by it, the result is still the same multiple (because scaling a vector only changes its length, not its direction) 8 (12,8) 2 (3,2) 3 12

  26. Eigenvectors & eigenvalues: not an integer multiple of the original vector * = 4 times the original vector * = = 4 * transformation matrix eigenvalue eigenvector (this vector and all multiples of it) Some properties of eigenvectors: eigenvectors can only be found for square matrices not every square matrix has eigenvectors given that an n x n matrix has eigenvectors, there are n of them the eigenvectors of a matrix are orthogonal, i.e. at right angles to each other if an eigenvector is scaled by some amount before multiplying the matrix by it, the result is still the same multiple (because scaling a vector only changes its length, not its direction) → thus, eigenvalues and eigenvectors come in pairs 8 (12,8) 2 (3,2) 3 12

  27. Outline: • Eigenvectors and eigenvalues • PCA: • Getting the data • Centering the data • Obtaining the covariance matrix • Performing an eigenvalue decomposition of the covariance matrix • Choosing components and forming a feature vector • Deriving the new data set

  28. Outline: • Eigenvectors and eigenvalues • PCA: • Getting the data • Centering the data • Obtaining the covariance matrix • Performing an eigenvalue decomposition of the covariance matrix • Choosing components and forming a feature vector • Deriving the new data set

  29. PCA • a technique for identifying patterns in data and expressing the data in such a way as to highlight their similarities and differences • once these patterns are found, the data can be compressed (i.e. the number of dimensions can be reduced) without much loss of information

  30. PCA • a technique for identifying patterns in data and expressing the data in such a way as to highlight their similarities and differences • once these patterns are found, the data can be compressed (i.e. the number of dimensions can be reduced) without much loss of information • example: data of 2 dimensions: original data:

  31. PCA • a technique for identifying patterns in data and expressing the data in such a way as to highlight their similarities and differences • once these patterns are found, the data can be compressed (i.e. the number of dimensions can be reduced) without much loss of information • example: data of 2 dimensions: original data: centered data:

  32. PCA • a technique for identifying patterns in data and expressing the data in such a way as to highlight their similarities and differences • once these patterns are found, the data can be compressed (i.e. the number of dimensions can be reduced) without much loss of information • example: data of 2 dimensions: original data: centered data:

  33. Eigenvalues of the covariance matrix: Eigenvectors of the covariance matrix: Covariance matrix: * unit eigenvectors original data: centered data:

  34. Eigenvalues of the covariance matrix: Eigenvectors of the covariance matrix: Covariance matrix: * unit eigenvectors original data: centered data:

  35. Compression and reduced dimensionality: • the eigenvector associated with the highest eigenvalue is the principal component of the dataset; it captures the most significant relationship between the data dimensions • ordering eigenvalues from highest to lowest gives the components in order of significance • if we want, we can ignore the components of lesser significance – this results in a loss of information, but if the eigenvalues are small, the loss will not be great • thus, in a dataset with n dimensions/variables, one may obtain the n eigenvectors & eigenvalues and decide to retain p of them → this results in a final dataset with only p dimensions • feature vector – a vector containing only the eigenvectors representing the dimensions we want to keep – in our example data, 2 choices: • the final dataset is obtained by multiplying the transpose of the feature vector (on the left) with the transposed original dataset • this will give us the original data solely in terms of the vectors we chose or

  36. Our example: • retain both eigenvectors: • retain only the first eigenvector / principal component: * data t = new data 2x2 2x10 2x10 * data t = new data 1x2 2x10 1x10 Original data, rotated so that the eigenvectors are the axes - no loss of information.

  37. Our example: • retain both eigenvectors: • retain only the first eigenvector / principal component: * data t = new data 2x2 2x10 2x10 * data t = new data 1x2 2x10 1x10 Original data, rotated so that the eigenvectors are the axes - no loss of information. Only 1 dimension left – we threw away the other axis. Thus: we transformed the data so that is expressed in terms of the patterns, where the patterns are the lines that most closely describe the relationships between the data. Now, the values of the data points tell us exactly where (i.e., above/below) the trend lines the data point sits.

  38. similar to Cholesky decomposition as one can use both to fully decompose the original covariance matrix • in addition, both produce uncorrelated factors • Eigenvalue decomposition: • Cholesky decomposition: • Eigenvalue: decomposition • C = E V E-1 • Cholesky decomposition: • C = ΛΨΛt va1 va2 ch1 ch2 * = v1 * l11 l21 l22 -1 var1 var2 = v11 v22 = pc1 pc2 e11 e21 e12 e22 var1 var2

  39. Thank you for your attention.

More Related