Repository: spark
Updated Branches:
  refs/heads/master d1aadea05 -> 87d69a01f


[MINOR][PYSPARK] update _shared_params_code_gen.py

## What changes were proposed in this pull request?

1, add arg-checkings for `tol` and `stepSize` to  keep in line with 
`SharedParamsCodeGen.scala`
2, fix one typo

## How was this patch tested?
local build

Author: Zheng RuiFeng <[email protected]>

Closes #12996 from zhengruifeng/py_args_checking.


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

Branch: refs/heads/master
Commit: 87d69a01f027aa18718827f94f921b4a1eaa78a5
Parents: d1aadea
Author: Zheng RuiFeng <[email protected]>
Authored: Fri May 13 08:52:06 2016 +0200
Committer: Nick Pentreath <[email protected]>
Committed: Fri May 13 08:52:06 2016 +0200

----------------------------------------------------------------------
 python/pyspark/ml/clustering.py                    |  2 +-
 python/pyspark/ml/param/_shared_params_code_gen.py |  6 +++---
 python/pyspark/ml/param/shared.py                  | 12 ++++++------
 3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/87d69a01/python/pyspark/ml/clustering.py
----------------------------------------------------------------------
diff --git a/python/pyspark/ml/clustering.py b/python/pyspark/ml/clustering.py
index b90daf1..9216331 100644
--- a/python/pyspark/ml/clustering.py
+++ b/python/pyspark/ml/clustering.py
@@ -517,7 +517,7 @@ class LDAModel(JavaModel):
     def estimatedDocConcentration(self):
         """
         Value for :py:attr:`LDA.docConcentration` estimated from data.
-        If Online LDA was used and :py:attr::`LDA.optimizeDocConcentration` 
was set to false,
+        If Online LDA was used and :py:attr:`LDA.optimizeDocConcentration` was 
set to false,
         then this returns the fixed (given) value for the 
:py:attr:`LDA.docConcentration` parameter.
         """
         return self._call_java("estimatedDocConcentration")

http://git-wip-us.apache.org/repos/asf/spark/blob/87d69a01/python/pyspark/ml/param/_shared_params_code_gen.py
----------------------------------------------------------------------
diff --git a/python/pyspark/ml/param/_shared_params_code_gen.py 
b/python/pyspark/ml/param/_shared_params_code_gen.py
index 12f1453..c32dcc4 100644
--- a/python/pyspark/ml/param/_shared_params_code_gen.py
+++ b/python/pyspark/ml/param/_shared_params_code_gen.py
@@ -124,12 +124,12 @@ if __name__ == "__main__":
          "E.g. 10 means that the cache will get checkpointed every 10 
iterations.", None,
          "TypeConverters.toInt"),
         ("seed", "random seed.", "hash(type(self).__name__)", 
"TypeConverters.toInt"),
-        ("tol", "the convergence tolerance for iterative algorithms.", None,
+        ("tol", "the convergence tolerance for iterative algorithms (>= 0).", 
None,
          "TypeConverters.toFloat"),
-        ("stepSize", "Step size to be used for each iteration of 
optimization.", None,
+        ("stepSize", "Step size to be used for each iteration of optimization 
(>= 0).", None,
          "TypeConverters.toFloat"),
         ("handleInvalid", "how to handle invalid entries. Options are skip 
(which will filter " +
-         "out rows with bad values), or error (which will throw an errror). 
More options may be " +
+         "out rows with bad values), or error (which will throw an error). 
More options may be " +
          "added later.", None, "TypeConverters.toString"),
         ("elasticNetParam", "the ElasticNet mixing parameter, in range [0, 1]. 
For alpha = 0, " +
          "the penalty is an L2 penalty. For alpha = 1, it is an L1 penalty.", 
"0.0",

http://git-wip-us.apache.org/repos/asf/spark/blob/87d69a01/python/pyspark/ml/param/shared.py
----------------------------------------------------------------------
diff --git a/python/pyspark/ml/param/shared.py 
b/python/pyspark/ml/param/shared.py
index 9ed63e4..c5ccf81 100644
--- a/python/pyspark/ml/param/shared.py
+++ b/python/pyspark/ml/param/shared.py
@@ -328,10 +328,10 @@ class HasSeed(Params):
 
 class HasTol(Params):
     """
-    Mixin for param tol: the convergence tolerance for iterative algorithms.
+    Mixin for param tol: the convergence tolerance for iterative algorithms 
(>= 0).
     """
 
-    tol = Param(Params._dummy(), "tol", "the convergence tolerance for 
iterative algorithms.", typeConverter=TypeConverters.toFloat)
+    tol = Param(Params._dummy(), "tol", "the convergence tolerance for 
iterative algorithms (>= 0).", typeConverter=TypeConverters.toFloat)
 
     def __init__(self):
         super(HasTol, self).__init__()
@@ -351,10 +351,10 @@ class HasTol(Params):
 
 class HasStepSize(Params):
     """
-    Mixin for param stepSize: Step size to be used for each iteration of 
optimization.
+    Mixin for param stepSize: Step size to be used for each iteration of 
optimization (>= 0).
     """
 
-    stepSize = Param(Params._dummy(), "stepSize", "Step size to be used for 
each iteration of optimization.", typeConverter=TypeConverters.toFloat)
+    stepSize = Param(Params._dummy(), "stepSize", "Step size to be used for 
each iteration of optimization (>= 0).", typeConverter=TypeConverters.toFloat)
 
     def __init__(self):
         super(HasStepSize, self).__init__()
@@ -374,10 +374,10 @@ class HasStepSize(Params):
 
 class HasHandleInvalid(Params):
     """
-    Mixin for param handleInvalid: how to handle invalid entries. Options are 
skip (which will filter out rows with bad values), or error (which will throw 
an errror). More options may be added later.
+    Mixin for param handleInvalid: how to handle invalid entries. Options are 
skip (which will filter out rows with bad values), or error (which will throw 
an error). More options may be added later.
     """
 
-    handleInvalid = Param(Params._dummy(), "handleInvalid", "how to handle 
invalid entries. Options are skip (which will filter out rows with bad values), 
or error (which will throw an errror). More options may be added later.", 
typeConverter=TypeConverters.toString)
+    handleInvalid = Param(Params._dummy(), "handleInvalid", "how to handle 
invalid entries. Options are skip (which will filter out rows with bad values), 
or error (which will throw an error). More options may be added later.", 
typeConverter=TypeConverters.toString)
 
     def __init__(self):
         super(HasHandleInvalid, self).__init__()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to