【发布时间】:2020-08-05 17:58:02
【问题描述】:
我正在尝试并行运行多个 Kmeans (from sklearn) 实例。我有以下代码:
with concurrent.futures.ProcessPoolExecutor() as executor:
kmeans_per_k = [executor.submit(KMeans(n_clusters=k, random_state=42).fit(features)) for k in range(1,16)]
for f in concurrent.futures.as_completed(kmeans_per_k):
f = f.result()
这给了我以下错误
TypeError: 'KMeans' object is not callable
【问题讨论】:
标签: python scikit-learn multiprocessing k-means