+ 2

Last project of DS With Python

Help please, Test 3,4 and 5 are failing and others are correct. I need your guys help! n = int(input()) X = [] for i in range(n): X.append([float(x) for x in input().split()]) from sklearn.preprocessing import StandardScaler from sklearn.cluster import KMeans import numpy as np from sklearn.metrics.pairwise import euclidean_distances scale = StandardScaler() scale.fit(X) X_scaled = scale.transform(X) kmeans = KMeans(n_clusters=2) kmeans.fit(X) s=(kmeans.cluster_centers_) for a in s: print(np.around(a,1))

20th Dec 2020, 11:48 AM
BatOchir Artur
BatOchir Artur - avatar
1 Answer
0
Hi
21st Dec 2020, 9:35 AM
Michael
Michael - avatar