gamma= /n_featuresin[ ]x_trainx_testy_trainy_test train_test_splitcancer datacancer targetrandom_state= svc svc(svc fit(x_trainy_trainprint("accuracy on training set{ }format(svc score(x_trainy_train))print("accuracy on test set{ }format(svc score(x_testy_test))out[ ]accuracy on training set accuracy on test set the model overfits quite substantiallywith perfect score on the training set and only accuracy on the test set while svms often perform quite wellthey are very sensitive to the settings of the parameters and to the scaling of the data in particularthey require all the features to vary on similar scale let' look at the minimum and maximum values for each featureplotted in log-space (figure - )in[ ]plt plot(x_train min(axis= )' 'label="min"plt plot(x_train max(axis= )'^'label="max"plt legend(loc= plt xlabel("feature index"plt ylabel("feature magnitude"plt yscale("log"from this plot we can determine that features in the breast cancer dataset are of completely different orders of magnitude this can be somewhat of problem for other models (like linear models)but it has devastating effects for the kernel svm let' examine some ways to deal with this issue supervised machine learning algorithms