Hi I am trying to do the final lab for week 3 of Natural Language Processing with Classification and Vector Spaces
Assignment: Vector Space Models | Coursera
My problem is with the final question, the compute_pca function
This is my attempt. There is something I am doing wrong about which way round each of the matrices is. The incoming X matrix for the example is of shape (3,10). I am sure that the covariance matrix I need is shape (10, 10). Just calling np.cov(X_demeaned) gives a (3, 3) covariance matrix so I am fairly confident that np.cov(X_demeaned, rowvar=False) is correct. But from then on I don’t have any confidence that the matrices or vectors are the right way round. I have to call eigen_vecs_subset.T to make the final dot product work, but the numbers it produces are wrong, so something somewhere is the wrong way round. I have tried so many different permuations of transposing things, taking columns not rows for subsets, etc, etc, but I haven’t been able to guess it. Can you help? Thank you!
Posting codes from grade cell function is against community guidelines. codes removed in violation of Code of Conduct. Kindly post screenshot of error or your output with expected output. If mentor wants to see your codes, they will ask you.