0% found this document useful (0 votes)
39 views

PCA Solved Example

The document provides a step-by-step example of Principal Component Analysis (PCA) using a small dataset with two features. It includes data standardization, calculation of the covariance matrix, and determination of eigenvalues and eigenvectors, ultimately selecting a principal component for data projection. The final PCA-transformed data is presented as a one-dimensional array.

Uploaded by

Mandeep Panchal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

PCA Solved Example

The document provides a step-by-step example of Principal Component Analysis (PCA) using a small dataset with two features. It includes data standardization, calculation of the covariance matrix, and determination of eigenvalues and eigenvectors, ultimately selecting a principal component for data projection. The final PCA-transformed data is presented as a one-dimensional array.

Uploaded by

Mandeep Panchal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Principal Component Analysis (PCA) - Solved Example

Given Dataset:

| Observation | Feature 1 | Feature 2 |

|-------------|-----------|-----------|

|1 | 2.5 | 2.4 |

|2 | 0.5 | 0.7 |

|3 | 2.2 | 2.9 |

Step 1: Create the Data Matrix

X = [[2.5, 2.4], [0.5, 0.7], [2.2, 2.9]]

Step 2: Standardize the Data (Centering)

Means: Feature 1 = 1.733, Feature 2 = 2.0

X_centered = [[0.767, 0.4], [-1.233, -1.3], [0.467, 0.9]]

Step 3: Covariance Matrix

C = [[1, 0.937], [0.937, 1]]

Step 4: Eigenvalues and Eigenvectors (Given)

Eigenvalues: 1.937 and 0.063

Eigenvectors: [0.707, 0.707] and [-0.707, 0.707]

Step 5: Select Principal Component

Chosen PC1 = [0.707, 0.707]

Step 6: Project Data


Z = X_centered * PC1

Z1 = 0.825

Z2 = -1.791

Z3 = 0.966

Final PCA-transformed 1D Data:

Z = [0.825, -1.791, 0.966]

You might also like