1.Load the data into a python program and center it.
1.Load the data into a python
2.Compute the covariance matrix of the data Σ in three different ways. de. Measure the time that each function takes to compute Σ for the dataset and report it in your Solution.pdf document. Discuss the differences in terms of
3.Compute the eigenvectors and eigenvalues of Σ. The numpy linear algebra module referenced above has a function that can help.
4. Determine the number of principal components (PCs) r that will ensure 90% retained variance? How did you compute this? Provide a function in your code that determines r based on an arbitrary percentage α of retained variance.
5. Plot the first two components in a figure with horizontal axis (x) corresponding to the dimensions and vertical axis (y) corresponding to the magnitude of the component in this dimension. There will be 2 traces with d points
in this figure. Include the figure in your pdf solution. Also save the top two components in a text file Components.txt” in the code folder, with each component on a separated line and represented as d comma separated numbers
Trending now
This is a popular solution!
Step by step
Solved in 2 steps