shifted and scaled you can see that all of the features are now between and as desired to apply the svm to the scaled datawe also need to transform the test set this is again done by calling the transform methodthis time on x_testin[ ]transform test data x_test_scaled scaler transform(x_testprint test data properties after scaling print("per-feature minimum after scaling:\ {}format(x_test_scaled min(axis= ))print("per-feature maximum after scaling:\ {}format(x_test_scaled max(axis= ))out[ ]per-feature minimum after scaling - per-feature maximum after scaling - - - - maybe somewhat surprisinglyyou can see that for the test setafter scalingthe minimum and maximum are not and some of the features are even outside the - rangethe explanation is that the minmaxscaler (and all the other scalersalways applies exactly the same transformation to the training and the test set this means the transform method always subtracts the training set minimum and divides by the training set rangewhich might be different from the minimum and range for the test set scaling training and test data the same way it is important to apply exactly the same transformation to the training set and the test set for the supervised model to work on the test set the following example (figure - illustrates what would happen if we were to use the minimum and range of the test set insteadin[ ]from sklearn datasets import make_blobs make synthetic data x_ make_blobs(n_samples= centers= random_state= cluster_std= split it into training and test sets x_trainx_test train_test_split(xrandom_state= test_size plot the training and test sets figaxes plt subplots( figsize=( ) unsupervised learning and preprocessing