Phân cụm trong Python
Shaumik Daityari
Business Analyst
timeit.linkage()from scipy.cluster.hierarchy import linkage import pandas as pd import random, timeitpoints = 100 df = pd.DataFrame({'x': random.sample(range(0, points), points), 'y': random.sample(range(0, points), points)})%timeit linkage(df[['x', 'y']], method = 'ward', metric = 'euclidean')
1.02 ms ± 133 µs mỗi vòng (trung bình ± độ lệch chuẩn của 7 lần chạy, 1000 vòng mỗi lần)

Phân cụm trong Python