When we find Ured , then how can we just take first k features, we haven’t sorted them, so how do we know that we are taking the best k or not. And if we are not taking best k, then why so.
Problem in Ureduce
hey @amoghjalan2005 ,
in the video you might have seen at the time when we have taken PCA from sklearn module ,
then we had calculated PCA for n_components = 2 .
So , just to explain and provide an understanding about PCA from scratch to students , we have taken k as to be 2 , so that we can show the similarity between the results coming from our sklearn module and and what we have implemented from scratch.
I hope this helps.
When implementation from scratch has been done. It is given:
U,s,v = svd(covar)
Ured = U[: , :2]
So, here directly we have taken first k=2 features from the eigenvectors of the covariance matrix. Hence, I didn’t get why we took first k features only.