svm fit(x_train_scaledy_trainscoring on the scaled test set print("svm test accuracy{ }format(svm score(x_test_scaledy_test))out[ ]svm test accuracy now that we've seen how simple data transformations for preprocessing worklet' move on to more interesting transformations using unsupervised learning dimensionality reductionfeature extractionand manifold learning as we discussed earliertransforming data using unsupervised learning can have many motivations the most common motivations are visualizationcompressing the dataand finding representation that is more informative for further processing one of the simplest and most widely used algorithms for all of these is principal component analysis we'll also look at two other algorithmsnon-negative matrix factorization (nmf)which is commonly used for feature extractionand -snewhich is commonly used for visualization using two-dimensional scatter plots principal component analysis (pcaprincipal component analysis is method that rotates the dataset in way such that the rotated features are statistically uncorrelated this rotation is often followed by selecting only subset of the new featuresaccording to how important they are for explaining the data the following example (figure - illustrates the effect of pca on synthetic two-dimensional datasetin[ ]mglearn plots plot_pca_illustration(the first plot (top leftshows the original data pointscolored to distinguish among them the algorithm proceeds by first finding the direction of maximum variancelabeled "component this is the direction (or vectorin the data that contains most of the informationor in other wordsthe direction along which the features are most correlated with each other thenthe algorithm finds the direction that contains the most information while being orthogonal (at right angleto the first direction in two dimensionsthere is only one possible orientation that is at right anglebut in higher-dimensional spaces there would be (infinitelymany orthogonal directions although the two components are drawn as arrowsit doesn' really matter where the head and the tail arewe could have drawn the first component from the center up to unsupervised learning and preprocessing