Presented by: Muhammad Wasif Laeeq (BSIT07-1) Muhammad Aatif Aneeq (BSIT07-15) Shah Rukh (BSIT07-22) Mudasir Abbas (BSIT07-34) Ahmad Mushtaq (BSIT07-45) PRINCIPLE COMPONENT ANALYSIS
BZUPAGES.COM Study Hours G.P.A. Student A64 Student B53.2 Student C42.75 Student D22 Student E x 2 Matrix
BZUPAGES.COM
BZUPAGES.COM Var1Var9000 Student A Student B Student C Student D Student E 5 x 9000 Matrix
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM THE DEFINITION Principal component analysis (PCA) is a mathematical procedure that uses an orthogonal transformation to convert a set of observations of possibly correlated variables into a set of values of uncorrelated variables called principal components.
BZUPAGES.COM Principal Components are always perpendicular to each other The number of principal components is less than or equal to the number of original variables First Principal Component has highest Variance
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM WHERE TO USE Used to uncover unknown trends Used to summarize Data Visualization of high dimension Data Dimensionality Reduction
BZUPAGES.COM BACKGROUND MATHEMATICS BY SHAHRUKH
Mean Standard Deviation Variance Covariance The covariance Matrix STATISTICS
Eigenvectors Eigenvalues MATHEMATICS Matrix Algebra
STATISTICS Mean
STATISTICS Standard deviation The average distance from the mean of the data set to a point
STATISTICS Cont.. To compute the squares of the distance from each data point to the mean of the set, add them all up, divide by n-1 and take the positive square root
STATISTICS Variance Variance is another measure of the spread of data in a data set. In fact it is almost identical to the standard deviation. The formula is this:
STATISTICS Covariance When there are than two dimensions of data then we use this, The formula is :
STATISTICS The covariance Matrix When there are more than two dimensions of data then we use this. The formula is : Suppose we have three dimensions of data:
Eigenvectors Eigenvalues MATHEMATICS Matrix Algebra
Eigenvectors:- The eigenvectors of a square matrix are the non- zero vectors which, after being multiplied by the matrix, remain proportional to the original vector. MATHEMATICS Cont…
Eigenvalues:- For each eigenvector, the corresponding eigenvalue is the factor by which the eigenvector changes when multiplied by the matrix. MATHEMATICS Cont…
MATHEMATICS Eigenvectors, Eigenvalues
PCA IN
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM
BZUPAGES.COM So how do we detect a face? Any face can be identified by multiplying the eigen-faces to the name minus average. If the image we “project” from the face space is close enough to the actual image detected then we found what we are looking for…
PCA IN ACTION!
BZUPAGES.COM Suppose we have a 2 dimensional data:
BZUPAGES.COM The first step of PCA is to obtain covariance matrix Variance of x1 Variance of x2 Covariance of x1-x2 Variance(1) Cov(1,2) Cov(1,2)Variance(2)
BZUPAGES.COM Formula for variance: Formula for Covariance
BZUPAGES.COM Step 2: is to obtain Eigen Values by solving function determinant Solving a the above equation gives two values of And these two values are Eigen Values
BZUPAGES.COM Step 3: is to obtain Eigen Vector by solving for matrix X in such a way that, Cov Matrix
BZUPAGES.COM Step 4: is to obtain coordinates of data point in the direction of Eigen Vectors We obtain this by multiplying centered data matrix to the Eigen vector matrix.
BZUPAGES.COM Lets have a look at an Excell Workbook
BZUPAGES.COM Our covariance matrix is:
BZUPAGES.COM Lets find out the Eigen Values: By solving function determinant: * Solving = ,
BZUPAGES.COM Now we will find out Eigen Vectors: By solving the following matrix: Substract the 1 st Eigen value from variance terms of co-variance matrix of Step 1, we obtain
BZUPAGES.COM Finding Eigen Vectors: Now for 1 st Eigen Vector: X= abab 0000 We get a=0.6262, b= Similarly for 2 nd Eigen value , We get a= and b=
BZUPAGES.COM Now obtain cordinates of data point in the direction of Eigen Vectors
BZUPAGES.COM