Skip to content
Snippets Groups Projects
Commit d3569015 authored by Shally Sangal's avatar Shally Sangal Committed by Joseph K. Bradley
Browse files

[SPARK-14284][ML] KMeansSummary deprecating size; adding clusterSizes

## What changes were proposed in this pull request?

KMeansSummary class : deprecated size and added clusterSizes

Author: Shally Sangal <shallysangal@gmail.com>

Closes #12084 from shallys/master.
parent 78071736
No related branches found
No related tags found
No related merge requests found
......@@ -299,7 +299,8 @@ class KMeansSummary private[clustering] (
* Size of each cluster.
*/
@Since("2.0.0")
lazy val size: Array[Int] = cluster.rdd.map {
lazy val clusterSizes: Array[Int] = cluster.rdd.map {
case Row(clusterIdx: Int) => (clusterIdx, 1)
}.reduceByKey(_ + _).collect().sortBy(_._1).map(_._2)
}
......@@ -37,7 +37,7 @@ private[r] class KMeansWrapper private (
lazy val k: Int = kMeansModel.getK
lazy val size: Array[Int] = kMeansModel.summary.size
lazy val size: Array[Int] = kMeansModel.summary.clusterSizes
lazy val cluster: DataFrame = kMeansModel.summary.cluster
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment