Unit3
Unit3
# Generate synthetic data: 100 points around (1,1) and 100 points
around (5,5)
np.random.seed(42)
data1 = np.random.randn(100, 2) + np.array([1, 1])
data2 = np.random.randn(100, 2) + np.array([5, 5])
data = np.vstack((data1, data2))
clusters.append(cluster1)
clusters.append(cluster2)
return clusters
# Convert to DataFrame
df = pd.DataFrame(data, columns=[f'Subject {i+1}' for i in range(10)])
print("Original Student Scores:")
print(df)
# Step 1: Standardizing the Data
scaler = StandardScaler()
scaled_data = scaler.fit_transform(df)