From d28bf4182758f08862d5838c918756801a9d7327 Mon Sep 17 00:00:00 2001 From: Reza Zadeh <rizlar@gmail.com> Date: Fri, 17 Jan 2014 13:39:40 -0800 Subject: [PATCH] changes from PR --- docs/mllib-guide.md | 5 +++-- .../org/apache/spark/examples/{ => mllib}/SparkSVD.scala | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) rename examples/src/main/scala/org/apache/spark/examples/{ => mllib}/SparkSVD.scala (98%) diff --git a/docs/mllib-guide.md b/docs/mllib-guide.md index a140ecb618..26350ce106 100644 --- a/docs/mllib-guide.md +++ b/docs/mllib-guide.md @@ -445,11 +445,12 @@ Given an *m x n* matrix *A*, we can compute matrices *U, S, V* such that *A = U * S * V^T* -There is no restriction on m, but we require n^2 doubles to fit in memory. +There is no restriction on m, but we require n^2 doubles to +fit in memory locally on one machine. Further, n should be less than m. The decomposition is computed by first computing *A^TA = V S^2 V^T*, -computing svd locally on that (since n x n is small), +computing SVD locally on that (since n x n is small), from which we recover S and V. Then we compute U via easy matrix multiplication as *U = A * V * S^-1* diff --git a/examples/src/main/scala/org/apache/spark/examples/SparkSVD.scala b/examples/src/main/scala/org/apache/spark/examples/mllib/SparkSVD.scala similarity index 98% rename from examples/src/main/scala/org/apache/spark/examples/SparkSVD.scala rename to examples/src/main/scala/org/apache/spark/examples/mllib/SparkSVD.scala index ce7c1c48b5..50e5f5bd87 100644 --- a/examples/src/main/scala/org/apache/spark/examples/SparkSVD.scala +++ b/examples/src/main/scala/org/apache/spark/examples/mllib/SparkSVD.scala @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.spark.examples +package org.apache.spark.examples.mllib import org.apache.spark.SparkContext import org.apache.spark.mllib.linalg.SVD -- GitLab