Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/6501#discussion_r31376865
--- Diff: docs/ml-features.md ---
@@ -876,5 +876,95 @@ bucketedData = bucketizer.transform(dataFrame)
</div>
</div>
+## ElementwiseProduct
+
+ElementwiseProduct multiplies each input vector by a provided "weight"
vector, using element-wise multiplication. In other words, it scales each
column of the dataset by a scalar multiplier. This represents the [Hadamard
product](https://en.wikipedia.org/wiki/Hadamard_product_%28matrices%29) between
the input vector, `v` and transforming vector, `w`, to yield a result vector.
+
+`\[ \begin{pmatrix}
+v_1 \\
+\vdots \\
+v_N
+\end{pmatrix} \circ \begin{pmatrix}
+ w_1 \\
+ \vdots \\
+ w_N
+ \end{pmatrix}
+= \begin{pmatrix}
+ v_1 w_1 \\
+ \vdots \\
+ v_N w_N
+ \end{pmatrix}
+\]`
+
+[`ElementwiseProduct`](api/scala/index.html#org.apache.spark.ml.feature.ElementwiseProduct)
takes the following parameter:
+
+* `scalingVec`: the transforming vector.
+
+This example below demonstrates how to transform vectors using a
transforming vector value.
+
+<div class="codetabs">
+<div data-lang="scala">
+{% highlight scala %}
+import org.apache.spark.SparkContext._
--- End diff --
Do you need this import?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]