diff options
author | Reza Zadeh <rizlar@gmail.com> | 2013-12-26 23:21:57 -0500 |
---|---|---|
committer | Reza Zadeh <rizlar@gmail.com> | 2013-12-26 23:21:57 -0500 |
commit | 16de5268e3652498b47b0600fe5cf9cf10d0dd83 (patch) | |
tree | 8e35a0634e67c61bfcf10661887a4ffa5ad4a9a7 /mllib | |
parent | fe1a132d403e301a674da6f4af7163df210ec2af (diff) | |
download | spark-16de5268e3652498b47b0600fe5cf9cf10d0dd83.tar.gz spark-16de5268e3652498b47b0600fe5cf9cf10d0dd83.tar.bz2 spark-16de5268e3652498b47b0600fe5cf9cf10d0dd83.zip |
full rank matrix test added
Diffstat (limited to 'mllib')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/mllib/linalg/sparsesvd.scala | 10 |
1 files changed, 9 insertions, 1 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 7bb393de8b..2ce0df1e5d 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 @@ -61,6 +61,14 @@ object SVD { RDD[((Int, Int), Double)], RDD[((Int, Int), Double)]) = { + if (m < n) { + 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") + } + val sc = data.sparkContext // Compute A^T A, assuming rows are sparse enough to fit in memory @@ -86,7 +94,7 @@ object SVD { // threshold s values if(sigma.isEmpty) { - // TODO: return empty + throw new Exception("All singular values are smaller than min_svalue: " + min_svalue) } // prepare V for returning |