# Summary of PCA Learning

Source: Internet
Author: User

1. PCA Holistic Thinking

Pca,principle componet analysis, PCA, mainly used for data dimensionality reduction. By calculating the eigenvalues and eigenvectors of the covariance matrix of a given data set, it obtains the most critical direction of the dataset (the projection variance of the dataset is the largest in this direction, which can keep the most information), and the first k-dimensional space is selected from the key direction, in which the original data is re-represented to achieve the purpose of dimensionality reduction.

2. Derivation process

Http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf

3. Basic steps of the algorithm

Input: DataSet X (DxN)

Output: Eigenvalues E (Dx1), Eigenvector V (DxD, eigenvectors stored in columns), sample mean for each dimension (DX1)

Procedure: 1. Calculates the covariance matrix C for X

2. Find the eigenvalues E and eigenvectors V of C and arrange them in descending order of eigenvalues

3. Select the first k eigenvector (i.e. the first k column) of V to form the matrix P (DXK)

4. The X element x is projected on the front k eigenvectors of P, resulting in XX (k,1), resulting in a projection matrix Z (KXN) of X on K eigenvectors.

5. Reconstruct xx with Z and compare with X to calculate the reconstruction error

4. MATLAB implementation of PCA

`[V, E] = Eig (cov (X ')) [E index] = sort (Diag (e), ' descend '); v = V (:, index); Meanx = mean (X ') '; P=v (:, [1:k]) [r,c] = size (X); Y = P ' * (X-repmat (meanx,1,c)); [R,c] = size (Y); XX = P * Y + repmat (Meanx, 1, c);`

5. PCA main Application

Face recognition, handwriting recognition with relatively more.

a fairly good copy of PCA profile:http://pan.baidu.com/s/1wDfKq

Summary of PCA Learning

Related Keywords:

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.