With dozens of features, data is hard to see at a glance. PCA finds the few directions in which the data spreads the most and summarizes the data along them, reducing it to a small number of axes. Looking at how much of the original information those few axes hold (the variance ratio) tells you how few axes you can get away with. Complete variance_ratio_2d(X). X is a 2-D float array whose rows are samples and columns are features. Extract 2 principal components with PCA and return, as a length-2 array, the share of variance each of the two components explains. Example [0.7, 0.2] means the first axis holds 70% and the second holds 20% of the variance.
This challenge asks you to complete a function that uses scikit-learn's PCA to extract 2 principal components from a 2-D feature array and returns each component's explained variance ratio as a length-2 array, larger ratio first. It practices dimensionality reduction β summarizing many features along a few directions β and reading how much of the original information those few axes hold.
PCA finds the few directions in which the data spreads the most and summarizes the data along them, and the explained variance ratio tells you how much of the original information those axes hold. This problem extracts components with scikit-learn and verifies the variance ratios against real numbers rather than trusting a plausible-looking result.