Repository: spark Updated Branches: refs/heads/master b73defdd7 -> ad3708e78
[SPARK-16653][ML][OPTIMIZER] update ANN convergence tolerance param default to 1e-6 ## What changes were proposed in this pull request? replace ANN convergence tolerance param default from 1e-4 to 1e-6 so that it will be the same with other algorithms in MLLib which use LBFGS as optimizer. ## How was this patch tested? Existing Test. Author: WeichenXu <weichenxu...@outlook.com> Closes #14286 from WeichenXu123/update_ann_tol. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/ad3708e7 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/ad3708e7 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/ad3708e7 Branch: refs/heads/master Commit: ad3708e78377d631e3d586548c961f4748322bf0 Parents: b73defd Author: WeichenXu <weichenxu...@outlook.com> Authored: Mon Jul 25 20:00:37 2016 +0100 Committer: Sean Owen <so...@cloudera.com> Committed: Mon Jul 25 20:00:37 2016 +0100 ---------------------------------------------------------------------- .../ml/classification/MultilayerPerceptronClassifier.scala | 4 ++-- python/pyspark/ml/classification.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/ad3708e7/mllib/src/main/scala/org/apache/spark/ml/classification/MultilayerPerceptronClassifier.scala ---------------------------------------------------------------------- diff --git a/mllib/src/main/scala/org/apache/spark/ml/classification/MultilayerPerceptronClassifier.scala b/mllib/src/main/scala/org/apache/spark/ml/classification/MultilayerPerceptronClassifier.scala index 76ef32a..7264a99 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/classification/MultilayerPerceptronClassifier.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/classification/MultilayerPerceptronClassifier.scala @@ -100,7 +100,7 @@ private[classification] trait MultilayerPerceptronParams extends PredictorParams @Since("2.0.0") final def getInitialWeights: Vector = $(initialWeights) - setDefault(maxIter -> 100, tol -> 1e-4, blockSize -> 128, + setDefault(maxIter -> 100, tol -> 1e-6, blockSize -> 128, solver -> MultilayerPerceptronClassifier.LBFGS, stepSize -> 0.03) } @@ -190,7 +190,7 @@ class MultilayerPerceptronClassifier @Since("1.5.0") ( /** * Set the convergence tolerance of iterations. * Smaller value will lead to higher accuracy with the cost of more iterations. - * Default is 1E-4. + * Default is 1E-6. * * @group setParam */ http://git-wip-us.apache.org/repos/asf/spark/blob/ad3708e7/python/pyspark/ml/classification.py ---------------------------------------------------------------------- diff --git a/python/pyspark/ml/classification.py b/python/pyspark/ml/classification.py index 613bc8c..9a3c7b1 100644 --- a/python/pyspark/ml/classification.py +++ b/python/pyspark/ml/classification.py @@ -1124,11 +1124,11 @@ class MultilayerPerceptronClassifier(JavaEstimator, HasFeaturesCol, HasLabelCol, @keyword_only def __init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", - maxIter=100, tol=1e-4, seed=None, layers=None, blockSize=128, stepSize=0.03, + maxIter=100, tol=1e-6, seed=None, layers=None, blockSize=128, stepSize=0.03, solver="l-bfgs", initialWeights=None): """ __init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \ - maxIter=100, tol=1e-4, seed=None, layers=None, blockSize=128, stepSize=0.03, \ + maxIter=100, tol=1e-6, seed=None, layers=None, blockSize=128, stepSize=0.03, \ solver="l-bfgs", initialWeights=None) """ super(MultilayerPerceptronClassifier, self).__init__() @@ -1141,11 +1141,11 @@ class MultilayerPerceptronClassifier(JavaEstimator, HasFeaturesCol, HasLabelCol, @keyword_only @since("1.6.0") def setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", - maxIter=100, tol=1e-4, seed=None, layers=None, blockSize=128, stepSize=0.03, + maxIter=100, tol=1e-6, seed=None, layers=None, blockSize=128, stepSize=0.03, solver="l-bfgs", initialWeights=None): """ setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \ - maxIter=100, tol=1e-4, seed=None, layers=None, blockSize=128, stepSize=0.03, \ + maxIter=100, tol=1e-6, seed=None, layers=None, blockSize=128, stepSize=0.03, \ solver="l-bfgs", initialWeights=None) Sets params for MultilayerPerceptronClassifier. """ --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org