Pharmaceutical, Machine Learning, Graph Theory, Linear Programming.
# Building and fitting the model kmeanModel = KMeans(n_clusters=k,random_state=0) kmeanModel.fit(X) distortions.append(sum(np.min(cdist(X, kmeanModel.cluster_centers_, 'euclidean'), axis=1)) / X.shape[0]) inertias.append(kmeanModel.inertia_) mapping1[k] = sum(np.min(cdist(X,