Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/9229#discussion_r56208138
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/MultilayerPerceptronClassifier.scala
---
@@ -65,7 +66,42 @@ private[ml] trait MultilayerPerceptronParams extends
PredictorParams
/** @group getParam */
final def getBlockSize: Int = $(blockSize)
- setDefault(maxIter -> 100, tol -> 1e-4, layers -> Array(1, 1), blockSize
-> 128)
+ /**
+ * Optimizer setup.
+ * @group expertParam
+ */
+ final val optimizer: Param[String] = new Param[String](this, "optimizer",
+ " Allows setting the optimizer: minibatch gradient descent (GD) or
LBFGS. " +
+ " The latter is recommended one. ",
+ ParamValidators.inArray[String](Array("GD", "LBFGS")))
+
+ /** @group getParam */
+ final def getOptimizer: String = $(optimizer)
+
+ /**
+ * Learning rate.
+ * @group expertParam
+ */
+ final val learningRate: DoubleParam = new DoubleParam(this, "learning
rate",
+ " Sets the learning rate for gradient descent optimizer ",
+ ParamValidators.inRange(0, 1))
+
+ /** @group getParam */
+ final def getLearningRate: Double = $(learningRate)
+
+ /**
+ * Model weights. Can be returned either after training or after
explicit setting
+ * @group expertParam
+ */
+ final val weights: Param[Vector] = new Param[Vector](this, "weights",
--- End diff --
Is it okay to change it to `coefficients`? We did this for linear models to
avoid confusion with instance weights.
---
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]