Repository: spark
Updated Branches:
  refs/heads/branch-1.4 6391be872 -> 88399c34b


[SPARK-8053] [MLLIB] renamed scalingVector to scalingVec

I searched the Spark codebase for all occurrences of "scalingVector"

CC: mengxr

Author: Joseph K. Bradley <jos...@databricks.com>

Closes #6596 from jkbradley/scalingVec-rename and squashes the following 
commits:

d3812f8 [Joseph K. Bradley] renamed scalingVector to scalingVec

(cherry picked from commit 07c16cb5ba9cb0bfe34e8c0efbf06540a22d4e4e)
Signed-off-by: Xiangrui Meng <m...@databricks.com>


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

Branch: refs/heads/branch-1.4
Commit: 88399c34b25dd1fe90daf14cecdbd81058b95f51
Parents: 6391be8
Author: Joseph K. Bradley <jos...@databricks.com>
Authored: Tue Jun 2 22:56:56 2015 -0700
Committer: Xiangrui Meng <m...@databricks.com>
Committed: Tue Jun 2 22:57:12 2015 -0700

----------------------------------------------------------------------
 .../apache/spark/ml/feature/ElementwiseProduct.scala  |  2 +-
 .../spark/mllib/feature/ElementwiseProduct.scala      | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/88399c34/mllib/src/main/scala/org/apache/spark/ml/feature/ElementwiseProduct.scala
----------------------------------------------------------------------
diff --git 
a/mllib/src/main/scala/org/apache/spark/ml/feature/ElementwiseProduct.scala 
b/mllib/src/main/scala/org/apache/spark/ml/feature/ElementwiseProduct.scala
index 3ae1833..1e758cb 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/feature/ElementwiseProduct.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/feature/ElementwiseProduct.scala
@@ -41,7 +41,7 @@ class ElementwiseProduct(override val uid: String)
     * the vector to multiply with input vectors
     * @group param
     */
-  val scalingVec: Param[Vector] = new Param(this, "scalingVector", "vector for 
hadamard product")
+  val scalingVec: Param[Vector] = new Param(this, "scalingVec", "vector for 
hadamard product")
 
   /** @group setParam */
   def setScalingVec(value: Vector): this.type = set(scalingVec, value)

http://git-wip-us.apache.org/repos/asf/spark/blob/88399c34/mllib/src/main/scala/org/apache/spark/mllib/feature/ElementwiseProduct.scala
----------------------------------------------------------------------
diff --git 
a/mllib/src/main/scala/org/apache/spark/mllib/feature/ElementwiseProduct.scala 
b/mllib/src/main/scala/org/apache/spark/mllib/feature/ElementwiseProduct.scala
index b0985ba..d67fe6c 100644
--- 
a/mllib/src/main/scala/org/apache/spark/mllib/feature/ElementwiseProduct.scala
+++ 
b/mllib/src/main/scala/org/apache/spark/mllib/feature/ElementwiseProduct.scala
@@ -25,10 +25,10 @@ import org.apache.spark.mllib.linalg._
  * Outputs the Hadamard product (i.e., the element-wise product) of each input 
vector with a
  * provided "weight" vector. In other words, it scales each column of the 
dataset by a scalar
  * multiplier.
- * @param scalingVector The values used to scale the reference vector's 
individual components.
+ * @param scalingVec The values used to scale the reference vector's 
individual components.
  */
 @Experimental
-class ElementwiseProduct(val scalingVector: Vector) extends VectorTransformer {
+class ElementwiseProduct(val scalingVec: Vector) extends VectorTransformer {
 
   /**
    * Does the hadamard product transformation.
@@ -37,15 +37,15 @@ class ElementwiseProduct(val scalingVector: Vector) extends 
VectorTransformer {
    * @return transformed vector.
    */
   override def transform(vector: Vector): Vector = {
-    require(vector.size == scalingVector.size,
-      s"vector sizes do not match: Expected ${scalingVector.size} but found 
${vector.size}")
+    require(vector.size == scalingVec.size,
+      s"vector sizes do not match: Expected ${scalingVec.size} but found 
${vector.size}")
     vector match {
       case dv: DenseVector =>
         val values: Array[Double] = dv.values.clone()
-        val dim = scalingVector.size
+        val dim = scalingVec.size
         var i = 0
         while (i < dim) {
-          values(i) *= scalingVector(i)
+          values(i) *= scalingVec(i)
           i += 1
         }
         Vectors.dense(values)
@@ -54,7 +54,7 @@ class ElementwiseProduct(val scalingVector: Vector) extends 
VectorTransformer {
         val dim = values.length
         var i = 0
         while (i < dim) {
-          values(i) *= scalingVector(indices(i))
+          values(i) *= scalingVec(indices(i))
           i += 1
         }
         Vectors.sparse(size, indices, values)


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

Reply via email to