tweaks to docs

This commit is contained in:
Reza Zadeh 2014-01-01 19:53:14 -08:00
parent dd0d3f008b
commit 185c882606

View file

@ -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) =>