diff options
author | Zheng RuiFeng <ruifengz@foxmail.com> | 2016-04-25 10:30:55 +0200 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-04-25 10:30:55 +0200 |
commit | e6f954a5799d0996bf9f22e0fb67a2f0568b57a4 (patch) | |
tree | 1166b680bda0ae6b155c9854c11c33e9ce8de985 /mllib | |
parent | 761fc46c70f15ffc3f35ff87b6a5c9192af1c55f (diff) | |
download | spark-e6f954a5799d0996bf9f22e0fb67a2f0568b57a4.tar.gz spark-e6f954a5799d0996bf9f22e0fb67a2f0568b57a4.tar.bz2 spark-e6f954a5799d0996bf9f22e0fb67a2f0568b57a4.zip |
[SPARK-14758][ML] Add checking for StepSize and Tol
## What changes were proposed in this pull request?
add the checking for StepSize and Tol in sharedParams
## How was this patch tested?
Unit tests
Author: Zheng RuiFeng <ruifengz@foxmail.com>
Closes #12530 from zhengruifeng/ml_args_checking.
Diffstat (limited to 'mllib')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala b/mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala index 1d03a5b4f4..4ab0c16a1b 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/param/shared/SharedParamsCodeGen.scala @@ -71,8 +71,10 @@ private[shared] object SharedParamsCodeGen { ParamDesc[Double]("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", isValid = "ParamValidators.inRange(0, 1)"), - ParamDesc[Double]("tol", "the convergence tolerance for iterative algorithms"), - ParamDesc[Double]("stepSize", "Step size to be used for each iteration of optimization"), + ParamDesc[Double]("tol", "the convergence tolerance for iterative algorithms (>= 0)", + isValid = "ParamValidators.gtEq(0)"), + ParamDesc[Double]("stepSize", "Step size to be used for each iteration of optimization (>" + + " 0)", isValid = "ParamValidators.gt(0)"), ParamDesc[String]("weightCol", "weight column name. If this is not set or empty, we treat " + "all instance weights as 1.0"), ParamDesc[String]("solver", "the solver algorithm for optimization. If this is not set or " + |