diff options
author | Reza Zadeh <rizlar@gmail.com> | 2014-01-01 19:53:14 -0800 |
---|---|---|
committer | Reza Zadeh <rizlar@gmail.com> | 2014-01-01 19:53:14 -0800 |
commit | 185c882606112a49c1d7359cc1de00bd273c3050 (patch) | |
tree | 4f68b4257e4533ee09a43888b09228324d204685 /mllib | |
parent | dd0d3f008b5dd478fdfb6d20c53713ca0c7c2be1 (diff) | |
download | spark-185c882606112a49c1d7359cc1de00bd273c3050.tar.gz spark-185c882606112a49c1d7359cc1de00bd273c3050.tar.bz2 spark-185c882606112a49c1d7359cc1de00bd273c3050.zip |
tweaks to docs
Diffstat (limited to 'mllib')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/mllib/linalg/sparsesvd.scala | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/sparsesvd.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/sparsesvd.scala index 0ab05de872..83b2178c09 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/sparsesvd.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/sparsesvd.scala @@ -65,12 +65,10 @@ object SVD { throw new IllegalArgumentException("Expecting a tall and skinny matrix") } - if (min_svalue < 1.0e-9) { - throw new IllegalArgumentException("Minimum singular value must be greater than 1e-9") + if (min_svalue < 1.0e-8) { + throw new IllegalArgumentException("Minimum singular value requested must be greater than 1e-9") } - val sc = data.sparkContext - // Compute A^T A, assuming rows are sparse enough to fit in memory val rows = data.map(entry => (entry._1._1, (entry._1._2, entry._2))).groupByKey().cache() @@ -80,7 +78,6 @@ object SVD { ((colind1, colind2), mval1*mval2) } } }.reduceByKey(_+_) - // Construct jblas A^T A locally val ata = DoubleMatrix.zeros(n, n) for(entry <- emits.toArray) { @@ -97,6 +94,8 @@ object SVD { throw new Exception("All singular values are smaller than min_svalue: " + min_svalue) } + val sc = data.sparkContext + // prepare V for returning val retV = sc.makeRDD( Array.tabulate(V.rows, sigma.length){ (i,j) => |