You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by pw...@apache.org on 2014/01/15 07:50:50 UTC

[1/2] git commit: Fixed SVDPlusPlusSuite in Maven build.

Updated Branches:
  refs/heads/master 3a386e238 -> 087487e90


Fixed SVDPlusPlusSuite in Maven build.


Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/dfb15244
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/dfb15244
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/dfb15244

Branch: refs/heads/master
Commit: dfb152446d0b987ac15afac77b9c27d77c686d90
Parents: 74b46ac
Author: Reynold Xin <rx...@apache.org>
Authored: Tue Jan 14 22:18:43 2014 -0800
Committer: Reynold Xin <rx...@apache.org>
Committed: Tue Jan 14 22:18:43 2014 -0800

----------------------------------------------------------------------
 graphx/src/test/resources/als-test.data             | 16 ++++++++++++++++
 .../apache/spark/graphx/lib/SVDPlusPlusSuite.scala  | 10 +++-------
 2 files changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/dfb15244/graphx/src/test/resources/als-test.data
----------------------------------------------------------------------
diff --git a/graphx/src/test/resources/als-test.data b/graphx/src/test/resources/als-test.data
new file mode 100644
index 0000000..e476cc2
--- /dev/null
+++ b/graphx/src/test/resources/als-test.data
@@ -0,0 +1,16 @@
+1,1,5.0
+1,2,1.0
+1,3,5.0
+1,4,1.0
+2,1,5.0
+2,2,1.0
+2,3,5.0
+2,4,1.0
+3,1,1.0
+3,2,5.0
+3,3,1.0
+3,4,5.0
+4,1,1.0
+4,2,5.0
+4,3,1.0
+4,4,5.0

http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/dfb15244/graphx/src/test/scala/org/apache/spark/graphx/lib/SVDPlusPlusSuite.scala
----------------------------------------------------------------------
diff --git a/graphx/src/test/scala/org/apache/spark/graphx/lib/SVDPlusPlusSuite.scala b/graphx/src/test/scala/org/apache/spark/graphx/lib/SVDPlusPlusSuite.scala
index 057d9b3..e01df56 100644
--- a/graphx/src/test/scala/org/apache/spark/graphx/lib/SVDPlusPlusSuite.scala
+++ b/graphx/src/test/scala/org/apache/spark/graphx/lib/SVDPlusPlusSuite.scala
@@ -19,11 +19,7 @@ package org.apache.spark.graphx.lib
 
 import org.scalatest.FunSuite
 
-import org.apache.spark.SparkContext
-import org.apache.spark.SparkContext._
 import org.apache.spark.graphx._
-import org.apache.spark.graphx.util.GraphGenerators
-import org.apache.spark.rdd._
 
 
 class SVDPlusPlusSuite extends FunSuite with LocalSparkContext {
@@ -31,16 +27,16 @@ class SVDPlusPlusSuite extends FunSuite with LocalSparkContext {
   test("Test SVD++ with mean square error on training set") {
     withSpark { sc =>
       val svdppErr = 8.0
-      val edges = sc.textFile("mllib/data/als/test.data").map { line =>
+      val edges = sc.textFile(getClass.getResource("/als-test.data").getFile).map { line =>
         val fields = line.split(",")
         Edge(fields(0).toLong * 2, fields(1).toLong * 2 + 1, fields(2).toDouble)
       }
       val conf = new SVDPlusPlus.Conf(10, 2, 0.0, 5.0, 0.007, 0.007, 0.005, 0.015) // 2 iterations
       var (graph, u) = SVDPlusPlus.run(edges, conf)
       graph.cache()
-      val err = graph.vertices.collect.map{ case (vid, vd) =>
+      val err = graph.vertices.collect().map{ case (vid, vd) =>
         if (vid % 2 == 1) vd._4 else 0.0
-      }.reduce(_ + _) / graph.triplets.collect.size
+      }.reduce(_ + _) / graph.triplets.collect().size
       assert(err <= svdppErr)
     }
   }


[2/2] git commit: Merge pull request #434 from rxin/graphxmaven

Posted by pw...@apache.org.
Merge pull request #434 from rxin/graphxmaven

Fixed SVDPlusPlusSuite in Maven build.

This should go into 0.9.0 also.


Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/087487e9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/087487e9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/087487e9

Branch: refs/heads/master
Commit: 087487e90e4d6269d7a027f7cb718120f6c10505
Parents: 3a386e2 dfb1524
Author: Patrick Wendell <pw...@gmail.com>
Authored: Tue Jan 14 22:50:36 2014 -0800
Committer: Patrick Wendell <pw...@gmail.com>
Committed: Tue Jan 14 22:50:36 2014 -0800

----------------------------------------------------------------------
 graphx/src/test/resources/als-test.data             | 16 ++++++++++++++++
 .../apache/spark/graphx/lib/SVDPlusPlusSuite.scala  | 10 +++-------
 2 files changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------