Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengruifeng committed Apr 20, 2020
1 parent b050973 commit bb4539b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ class KMeansModel (@Since("1.0.0") val clusterCenters: Array[Vector],
@Since("1.0.0")
def predict(points: RDD[Vector]): RDD[Int] = {
val bcCentersWithNorm = points.context.broadcast(clusterCentersWithNorm)
val bcRadii = points.context.broadcast(statistics)
val bcStatistics = points.context.broadcast(statistics)
points.map(p =>
distanceMeasureInstance.findClosest(bcCentersWithNorm.value,
bcRadii.value, new VectorWithNorm(p))._1)
bcStatistics.value, new VectorWithNorm(p))._1)
}

/**
Expand Down

0 comments on commit bb4539b

Please sign in to comment.