Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
port mahout vector to spark
  • Loading branch information
soulmachine committed Aug 4, 2013
commit 6f943b140b816ba5373d63d724c132b9d0dcb8a8
4 changes: 2 additions & 2 deletions mllib/src/main/scala/spark/mllib/clustering/KMeans.scala
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class KMeans private (
val k = activeCenters(0).length
val dims = activeCenters(0)(0).dimension

val sums = Array.fill(runs, k)(activeCenters(0)(0).like)
val sums = Array.fill(runs, k)(activeCenters(0)(0).like())
val counts = Array.fill(runs, k)(0L)

for (point <- points; (centers, runIndex) <- activeCenters.zipWithIndex) {
Expand All @@ -155,7 +155,7 @@ class KMeans private (
sums(runIndex)(bestCenter) += point
counts(runIndex)(bestCenter) += 1
}

val contribs = for (i <- 0 until runs; j <- 0 until k) yield {
((i, j), (sums(i)(j), counts(i)(j)))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package spark.mllib.clustering

import scala.util.Random

import spark.mllib.math.vector.{Vector, DenseVector, SparseVector}
import spark.mllib.math.vector.{Vector, DenseVector, RandomAccessSparseVector}

import org.jblas.{DoubleMatrix, SimpleBlas}

Expand Down
Loading