pyspark 3.0 KMeansModel 在一组误差平方和内

pyspark 3.0 KMeansModel within set sum of squared errors

我正在尝试通过 computeCost 方法计算集合内误差平方和,但出现此错误:

AttributeError: 'KMeansModel' object has no attribute 'computeCost'

我想它已被弃用,但我找不到实现它的方法。我总是在搜索中获得 computeCost。

此问题已通过使用 model.summary.trainingCost 而不是 model.computeCost

解决