Question: Use this code segment to create 2 D synthetic data import numpy as np from sklearn.datasets import make _ blobs import matplotlib.pyplot as plt transformation

Use this code segment to create 2D synthetic data
import numpy as np
from sklearn.datasets import make_blobs
import matplotlib.pyplot as plt
transformation =[[0.60834549,-0.63667341],[[-0.40887718,0.85253229]]
D, y = make_blobs(n_samples=100, centers=1, random_state=42)
X = np.dot(D, transformation)
plt.show(plt.scatter(X[: ,0], X[: ,1]))
Using the data X which is not mean-centered, compute PCA. The recompute PCA after mean-centering X. For both cases, plot data along with the first eigenvector. Additionally, plot the two eigenvectors in a single figure and comment on it.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!