DAAL库K-means算法空簇处理机制咨询——对比MATLAB三种方式
Having worked extensively with Intel DAAL's machine learning libraries, I can clarify how its K-means implementation deals with empty clusters during optimization—since this detail is easy to miss in the official docs:
Default core behavior: Unlike MATLAB’s configurable flags, DAAL’s K-means doesn’t let you pick between erroring out, removing clusters, or reinitializing. Instead, it automatically maintains the specified number of clusters (
k) by reinitializing any empty cluster’s centroid. The strategy here mirrors MATLAB’s third option: it selects the single observation that’s farthest from its currently assigned centroid (or more precisely, the farthest from the closest non-empty cluster’s centroid) and sets that point as the new centroid for the empty cluster.No explicit configuration switch: DAAL doesn’t expose a direct parameter to change this behavior. If you need alternative handling—like treating empty clusters as an error or removing them entirely—you’ll have to implement post-processing logic: run the K-means algorithm, then check the cluster assignment results to filter out clusters with zero assigned samples, or add validation steps before/after iterations to flag empty clusters as errors.
内容的提问来源于stack exchange,提问作者BayesianMonk

