aboutsummaryrefslogtreecommitdiff
path: root/mllib
diff options
context:
space:
mode:
authorXiangrui Meng <meng@databricks.com>2014-10-08 22:35:14 -0700
committerXiangrui Meng <meng@databricks.com>2014-10-08 22:35:14 -0700
commit9c439d33160ef3b31173381735dfa8cfb7d552ba (patch)
tree50acd34cb084e38f7ee2fd7fd8bc5d833d2db9b3 /mllib
parentf706823b71c763fa8e8ceb9e1bd916d8dca7a639 (diff)
downloadspark-9c439d33160ef3b31173381735dfa8cfb7d552ba.tar.gz
spark-9c439d33160ef3b31173381735dfa8cfb7d552ba.tar.bz2
spark-9c439d33160ef3b31173381735dfa8cfb7d552ba.zip
[SPARK-3856][MLLIB] use norm operator after breeze 0.10 upgrade
Got warning msg: ~~~ [warn] /Users/meng/src/spark/mllib/src/main/scala/org/apache/spark/mllib/feature/Normalizer.scala:50: method norm in trait NumericOps is deprecated: Use norm(XXX) instead of XXX.norm [warn] var norm = vector.toBreeze.norm(p) ~~~ dbtsai Author: Xiangrui Meng <meng@databricks.com> Closes #2718 from mengxr/SPARK-3856 and squashes the following commits: 4f38169 [Xiangrui Meng] use norm operator
Diffstat (limited to 'mllib')
-rw-r--r--mllib/src/main/scala/org/apache/spark/mllib/feature/Normalizer.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/feature/Normalizer.scala b/mllib/src/main/scala/org/apache/spark/mllib/feature/Normalizer.scala
index 3afb477672..4734251127 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/feature/Normalizer.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/feature/Normalizer.scala
@@ -17,7 +17,7 @@
package org.apache.spark.mllib.feature
-import breeze.linalg.{DenseVector => BDV, SparseVector => BSV}
+import breeze.linalg.{DenseVector => BDV, SparseVector => BSV, norm => brzNorm}
import org.apache.spark.annotation.Experimental
import org.apache.spark.mllib.linalg.{Vector, Vectors}
@@ -47,7 +47,7 @@ class Normalizer(p: Double) extends VectorTransformer {
* @return normalized vector. If the norm of the input is zero, it will return the input vector.
*/
override def transform(vector: Vector): Vector = {
- var norm = vector.toBreeze.norm(p)
+ var norm = brzNorm(vector.toBreeze, p)
if (norm != 0.0) {
// For dense vector, we've to allocate new memory for new output vector.