let' try to extract the first three principal components now from our breast cancer feature set of features using svd we first center our feature matrix and then use svd and subsetting to extract the first three pcs using the following code in [ ]center the feature set bc_xc bc_x bc_x mean(axis= decompose using svd usvt np linalg svd(bc_xcget principal components pc vt get first principal components pc pc[: : pc shape out[ ]( we can now get the reduced feature set of three features by using the dot product operation we discussed earlier the following snippet gives us the final reduced feature set that can be used for modeling reduce feature set dimensionality np round(bc_xc dot(pc ) out[ ]array([[- - - ][- ]- ]- ][- ] - - ]]thus you can see how powerful svd and pca can be in helping us reduce dimensionality by extracting necessary features of course in machine learning systems and pipelines you can use utilities from scikitlearn instead of writing unnecessary code and equations the following code enables us to perform pca on our breast cancer feature set leveraging scikit-learn' apis in [ ]from sklearn decomposition import pca pca pca(n_components= pca fit(bc_xout[ ]pca(copy=trueiterated_power='auto'n_components= random_state=nonesvd_solver='auto'tol= whiten=falseto understand how much of the variance is explained by each of these principal componentsyou can use the following code in [ ]pca explained_variance_ratio_ out[ ]array( ]