spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gurwls...@apache.org
Subject spark git commit: Revert "[SPARK-26133][ML][FOLLOWUP] Fix doc for OneHotEncoder"
Date Wed, 05 Dec 2018 11:37:12 GMT
Repository: spark
Updated Branches:
  refs/heads/branch-2.4 d9b707e7c -> c9fd14c82


Revert "[SPARK-26133][ML][FOLLOWUP] Fix doc for OneHotEncoder"

This reverts commit d9b707e7c39a55a22dd55f8a4f537d861a3ce57c.


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

Branch: refs/heads/branch-2.4
Commit: c9fd14c823eaa1ef8c43e6c7ccbf9fbdaad4c786
Parents: d9b707e
Author: Hyukjin Kwon <gurwls223@apache.org>
Authored: Wed Dec 5 19:36:51 2018 +0800
Committer: Hyukjin Kwon <gurwls223@apache.org>
Committed: Wed Dec 5 19:36:51 2018 +0800

----------------------------------------------------------------------
 python/pyspark/ml/feature.py | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/c9fd14c8/python/pyspark/ml/feature.py
----------------------------------------------------------------------
diff --git a/python/pyspark/ml/feature.py b/python/pyspark/ml/feature.py
index 93ece80..eccb7ac 100755
--- a/python/pyspark/ml/feature.py
+++ b/python/pyspark/ml/feature.py
@@ -1731,22 +1731,22 @@ class OneHotEncoderEstimator(JavaEstimator, HasInputCols, HasOutputCols,
HasHand
     at most a single one-value per row that indicates the input category index.
     For example with 5 categories, an input value of 2.0 would map to an output vector of
     `[0.0, 0.0, 1.0, 0.0]`.
-    The last category is not included by default (configurable via :py:attr:`dropLast`),
+    The last category is not included by default (configurable via `dropLast`),
     because it makes the vector entries sum up to one, and hence linearly dependent.
     So an input value of 4.0 maps to `[0.0, 0.0, 0.0, 0.0]`.
 
-    .. note:: This is different from scikit-learn's OneHotEncoder, which keeps all categories.
-        The output vectors are sparse.
+    Note: This is different from scikit-learn's OneHotEncoder, which keeps all categories.
+    The output vectors are sparse.
 
-    When :py:attr:`handleInvalid` is configured to 'keep', an extra "category" indicating
invalid
-    values is added as last category. So when :py:attr:`dropLast` is true, invalid values
are
-    encoded as all-zeros vector.
+    When `handleInvalid` is configured to 'keep', an extra "category" indicating invalid
values is
+    added as last category. So when `dropLast` is true, invalid values are encoded as all-zeros
+    vector.
 
-    .. note:: When encoding multi-column by using :py:attr:`inputCols` and
-        :py:attr:`outputCols` params, input/output cols come in pairs, specified by the order
in
-        the arrays, and each pair is treated independently.
+    Note: When encoding multi-column by using `inputCols` and `outputCols` params, input/output
+    cols come in pairs, specified by the order in the arrays, and each pair is treated
+    independently.
 
-    .. seealso:: :py:class:`StringIndexer` for converting categorical values into category
indices
+    See `StringIndexer` for converting categorical values into category indices
 
     >>> from pyspark.ml.linalg import Vectors
     >>> df = spark.createDataFrame([(0.0,), (1.0,), (2.0,)], ["input"])
@@ -1754,7 +1754,7 @@ class OneHotEncoderEstimator(JavaEstimator, HasInputCols, HasOutputCols,
HasHand
     >>> model = ohe.fit(df)
     >>> model.transform(df).head().output
     SparseVector(2, {0: 1.0})
-    >>> ohePath = temp_path + "/ohe"
+    >>> ohePath = temp_path + "/oheEstimator"
     >>> ohe.save(ohePath)
     >>> loadedOHE = OneHotEncoderEstimator.load(ohePath)
     >>> loadedOHE.getInputCols() == ohe.getInputCols()


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


Mime
View raw message