Github user miccagiann commented on a diff in the pull request: https://github.com/apache/spark/pull/1624#discussion_r15723595 --- Diff: mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala --- @@ -247,16 +248,24 @@ class PythonMLLibAPI extends Serializable { dataBytesJRDD: JavaRDD[Array[Byte]], numIterations: Int, stepSize: Double, + regParam: Double, + regType: String, + intercept: Boolean, miniBatchFraction: Double, initialWeightsBA: Array[Byte]): java.util.List[java.lang.Object] = { + val lrAlg = new LinearRegressionWithSGD() + lrAlg.setIntercept(intercept) + lrAlg.optimizer + .setNumIterations(numIterations) + .setRegParam(regParam) + .setStepSize(stepSize) + if (regType == "l2") + lrAlg.optimizer.setUpdater(new SquaredL2Updater) + else if (regType == "l1") + lrAlg.optimizer.setUpdater(new L1Updater) --- End diff -- By adding the exception to the scala code, I am going to remove the `ValueError` exception used in the python code.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---