Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/6113#discussion_r30280922
--- Diff: docs/ml-features.md ---
@@ -183,6 +183,78 @@ for words_label in wordsDataFrame.select("words",
"label").take(3):
</div>
</div>
+## PolynomialExpansion
+
+[Polynomial expansion](http://en.wikipedia.org/wiki/Polynomial_expansion)
is the process of expanding your features into a polynomial space, which is
formulated by an n-degree combination of original dimensions. A
[PolynomialExpansion](api/scala/index.html#org.apache.spark.ml.feature.PolynomialExpansion)
class provides this functionality. The example below shows how to expand your
features into a 3-degree polynomial space.
+
+Note: We do not provide Python API for `PolynomialExpansion` in this
version.
+
+<div class="codetabs">
+<div data-lang="scala" markdown="1">
+{% highlight scala %}
+import org.apache.spark.ml.feature.PolynomialExpansion
+
+val data = Array(
+ Vectors.sparse(3, Seq((0, -2.0), (1, 2.3))),
+ Vectors.dense(-2.0, 2.3),
--- End diff --
Length should match other data. Also, can the data be made as simple as
possible, such as 3 length-2 vectors? (same for Java example)
Alternatively, you could load data via MLUtils.loadLibSVMFile
---
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]