spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject git commit: [Minor] use norm operator after breeze 0.10 upgrade
Date Thu, 09 Oct 2014 16:22:38 GMT
Repository: spark
Updated Branches:
  refs/heads/master 14f222f7f -> 1e0aa4deb


[Minor] use norm operator after breeze 0.10 upgrade

cc mengxr

Author: GuoQiang Li <witgo@qq.com>

Closes #2730 from witgo/SPARK-3856 and squashes the following commits:

2cffce1 [GuoQiang Li] use norm operator after breeze 0.10 upgrade


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

Branch: refs/heads/master
Commit: 1e0aa4deba65aa1241b9a30edb82665eae27242f
Parents: 14f222f
Author: GuoQiang Li <witgo@qq.com>
Authored: Thu Oct 9 09:22:32 2014 -0700
Committer: Xiangrui Meng <meng@databricks.com>
Committed: Thu Oct 9 09:22:32 2014 -0700

----------------------------------------------------------------------
 .../spark/mllib/feature/NormalizerSuite.scala     | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/1e0aa4de/mllib/src/test/scala/org/apache/spark/mllib/feature/NormalizerSuite.scala
----------------------------------------------------------------------
diff --git a/mllib/src/test/scala/org/apache/spark/mllib/feature/NormalizerSuite.scala b/mllib/src/test/scala/org/apache/spark/mllib/feature/NormalizerSuite.scala
index fb76dcc..2bf9d98 100644
--- a/mllib/src/test/scala/org/apache/spark/mllib/feature/NormalizerSuite.scala
+++ b/mllib/src/test/scala/org/apache/spark/mllib/feature/NormalizerSuite.scala
@@ -19,6 +19,8 @@ package org.apache.spark.mllib.feature
 
 import org.scalatest.FunSuite
 
+import breeze.linalg.{norm => brzNorm}
+
 import org.apache.spark.mllib.linalg.{DenseVector, SparseVector, Vectors}
 import org.apache.spark.mllib.util.LocalSparkContext
 import org.apache.spark.mllib.util.TestingUtils._
@@ -50,10 +52,10 @@ class NormalizerSuite extends FunSuite with LocalSparkContext {
 
     assert((data1, data1RDD.collect()).zipped.forall((v1, v2) => v1 ~== v2 absTol 1E-5))
 
-    assert(data1(0).toBreeze.norm(1) ~== 1.0 absTol 1E-5)
-    assert(data1(2).toBreeze.norm(1) ~== 1.0 absTol 1E-5)
-    assert(data1(3).toBreeze.norm(1) ~== 1.0 absTol 1E-5)
-    assert(data1(4).toBreeze.norm(1) ~== 1.0 absTol 1E-5)
+    assert(brzNorm(data1(0).toBreeze, 1) ~== 1.0 absTol 1E-5)
+    assert(brzNorm(data1(2).toBreeze, 1) ~== 1.0 absTol 1E-5)
+    assert(brzNorm(data1(3).toBreeze, 1) ~== 1.0 absTol 1E-5)
+    assert(brzNorm(data1(4).toBreeze, 1) ~== 1.0 absTol 1E-5)
 
     assert(data1(0) ~== Vectors.sparse(3, Seq((0, -0.465116279), (1, 0.53488372))) absTol
1E-5)
     assert(data1(1) ~== Vectors.dense(0.0, 0.0, 0.0) absTol 1E-5)
@@ -77,10 +79,10 @@ class NormalizerSuite extends FunSuite with LocalSparkContext {
 
     assert((data2, data2RDD.collect()).zipped.forall((v1, v2) => v1 ~== v2 absTol 1E-5))
 
-    assert(data2(0).toBreeze.norm(2) ~== 1.0 absTol 1E-5)
-    assert(data2(2).toBreeze.norm(2) ~== 1.0 absTol 1E-5)
-    assert(data2(3).toBreeze.norm(2) ~== 1.0 absTol 1E-5)
-    assert(data2(4).toBreeze.norm(2) ~== 1.0 absTol 1E-5)
+    assert(brzNorm(data2(0).toBreeze, 2) ~== 1.0 absTol 1E-5)
+    assert(brzNorm(data2(2).toBreeze, 2) ~== 1.0 absTol 1E-5)
+    assert(brzNorm(data2(3).toBreeze, 2) ~== 1.0 absTol 1E-5)
+    assert(brzNorm(data2(4).toBreeze, 2) ~== 1.0 absTol 1E-5)
 
     assert(data2(0) ~== Vectors.sparse(3, Seq((0, -0.65617871), (1, 0.75460552))) absTol
1E-5)
     assert(data2(1) ~== Vectors.dense(0.0, 0.0, 0.0) absTol 1E-5)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message