Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/21081#discussion_r182925491
--- Diff: mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala
---
@@ -144,8 +168,23 @@ class KMeansModel private[ml] (
// TODO: Replace the temp fix when we have proper evaluators defined for
clustering.
@Since("2.0.0")
def computeCost(dataset: Dataset[_]): Double = {
- SchemaUtils.checkColumnType(dataset.schema, $(featuresCol), new
VectorUDT)
- val data: RDD[OldVector] = dataset.select(col($(featuresCol))).rdd.map
{
+ val typeCandidates = List( new VectorUDT,
--- End diff --
You can reuse validateAndTransformSchema here.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]