PCA with Python!

PCA is more than a century old algorithm,  invented in 1901 by Karl Pearson, now used for feature extraction and data exploration. We have already see here, now lts see some code in action.PCA is all about fining the vectors that maximize the distance of projected points on to the vector, for example, orthogonal projection of  (a)  on to a vector (b) we need to find the (a_{1}) scalar projection of the point(point is a vector) with reference to the vector (b) and multiply by the unit vector of (b), here(a_{1}=a.hat{b}), where (hat{b}) is unit vector of (b)We can say, when we have X points and w vectors, we say maximize (Xw), that is (maximize  (Xw)^2)[argmaxspace L (w)= ||Xw||^2], [L(w)=||wX||.||wX||^T = w^TX^TXw  space space constraint space w^Tw =1]Using Lagrange multipliers[L(w) = w^T(X^TX)w-lambda (w^Tw-1)=0]Skipping steps…
Read More