Can you help me with this python code? it is running, however I am…

Question Answered step-by-step Can you help me with this python code? it is running, however I am… Can you help me with this python code? it is running, however I am getting this error message and im not sure how to fix it?The message is being outputted with the 3d graphsImage transcription text/var/folders/w4/6105x_25331idlymfgbls_d00000gn/T/ipykernel_13171/1526663683. py: 42:MatplotlibDeprecationWarning: A xes3D(fig) adding itself to the figure is deprecated since 3.4. Pass thekeyword argument auto_add_to_figure=False and use fig. add_axes (ax) to suppress this warning. … Show more… Show moreHere is the code for reference: #import the required libraries import numpy as npimport seaborn as snsfrom sklearn.datasets import load_breast_cancerimport pandas as pdimport matplotlib.pyplot as pltfrom sklearn.preprocessing import StandardScalerfrom sklearn.decomposition import PCAfrom mpl_toolkits.mplot3d import Axes3D# Ḷoad the datadata = load_breast_cancer()X,y = data.data,data.targetscaler = StandardScaler()#  Scale the data using Standard ScalerX_transformed  = scaler.fit_transform(X)   # Initialize PCA object with  two componentspca = PCA(n_components=2)# Find pca components for the datapca.fit(X_transformed)# Apply transformation to scaled datareduced_X = pca.transform(X_transformed)cmap = plt.cm.get_cmap(“Spectral”)# Print the shape and values of componenets# Print the shape of scaled and PCA transformed datasetprint(“Original Shape:”,X_transformed.shape)print(“Reduced Shape:”,reduced_X.shape)print(“PCA component shape “,pca.components_.shape)print(“PCA components:n”,pca.components_)# Plot the pca components with appropriate labelsplt.scatter(reduced_X[:,0],reduced_X[:,1],c=data.target,edgecolors=’black’,alpha=0.7,)plt.xlabel(“First Principal Component”)plt.ylabel(“Second Principal Component”)plt.show() #The message is outputted at the beginning of each 3d graph below # Plot the 3d plot of scaled dataset as stated in the questionfig = plt.figure(figsize=(10,8))cmap = plt.cm.get_cmap(“Spectral”)ax = Axes3D(fig,rect=[0,0,.95,1],elev = 10,azim =10)ax.scatter(X_transformed[:,0],X_transformed[:,1],X_transformed[:,2],c=data.target,cmap=cmap)ax.set_title(“Plot of scaled dataset”)plt.show() # Plot the 3d plot of componenets as stated in the questionfig = plt.figure(figsize=(10,8))cmap = plt.cm.get_cmap(“Spectral”)ax = Axes3D(fig,rect=[0,0,.95,1],elev = 10,azim =10)ax.scatter(reduced_X[:,0],reduced_X[:,1],c=data.target,cmap=cmap)ax.set_title(“Plot of PCA-transformed dataset”)plt.show() Computer Science Engineering & Technology Python Programming IT SIT384 Share QuestionEmailCopy link Comments (0)