i cannot contact with my csv dataset information and configure the kmeans clustering on it please help me!

my dataset form is:

       Unnamed: 0         Name  Age  Weight  Height
0               0      person0   59     133     163
1               1      person1   36      94     166
2               2      person2   58      49     165
3               3      person3   64     104     184
4               4      person4    3      78     144
5               5      person5   78     138     158
6               6      person6   88     115     195
7               7      person7   79     113     193
.
.
.
99999

my code:

dataset = pd.read_csv(r'RandomPersonsInfo100K.csv')
dataset.head()
print(dataset)

X, y = dataset(n_samples=100000,
               n_features=3,
               centers=5,
               cluster_std=5,
               shuffle=True,
               random_state=0)
import matplotlib.pyplot as plt
plt.scatter(X[:,0],
            X[:,1],
            c='white',
            marker='o',
            edgecolor='black',
            s=50)
plt.grid()
plt.show()

from sklearn.cluster import KMeans
km = KMeans(n_clusters=3,
            init='random',
            n_init=10,
            max_iter=300,
            tol=1e-04,
            random_state=0)
y_km = km.fit_predict(X)

0 Answers