Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6576#discussion_r31558267
  
    --- Diff: 
examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionExample.scala
 ---
    @@ -0,0 +1,149 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.examples.ml
    +
    +import scala.collection.mutable
    +import scala.language.reflectiveCalls
    +
    +import scopt.OptionParser
    +
    +import org.apache.spark.{SparkConf, SparkContext}
    +import org.apache.spark.examples.mllib.AbstractParams
    +import org.apache.spark.ml.{Pipeline, PipelineStage}
    +import org.apache.spark.ml.regression.{LinearRegression, 
LinearRegressionModel}
    +import org.apache.spark.sql.DataFrame
    +
    +/**
    + * An example runner for linear regression with elastic-net (mixing L1/L2) 
regularization.
    + * Run with
    + * {{{
    + * bin/run-example ml.LinearRegressionExample [options]
    + * }}}
    + * A synthetic dataset can be found at 
`data/mllib/sample_linear_regression_data.txt` which can be
    + * trained by
    + * {{{
    + * bin/run-example ml.LinearRegressionExample --regParam 0.15 
--elasticNetParam 1.0 \
    + *   data/mllib/sample_linear_regression_data.txt
    + * }}}
    + * If you use it as a template to create your own app, please use 
`spark-submit` to submit your app.
    + */
    +object LinearRegressionExample {
    +
    +  case class Params(
    +      input: String = null,
    +      testInput: String = "",
    +      dataFormat: String = "libsvm",
    +      regParam: Double = 0.0,
    +      elasticNetParam: Double = 0.0,
    +      maxIter: Int = 100,
    +      tol: Double = 1E-6,
    +      fracTest: Double = 0.2) extends AbstractParams[Params]
    +
    +  def main(args: Array[String]) {
    +    val defaultParams = Params()
    +
    +    val parser = new OptionParser[Params]("LinearRegressionExample") {
    +      head("LinearRegressionExample: an example Linear Regression with 
Elastic-Net app.")
    +      opt[Double]("regParam")
    +        .text(s"regularization parameter, default: 
${defaultParams.regParam}")
    +        .action((x, c) => c.copy(regParam = x))
    +      opt[Double]("elasticNetParam")
    +        .text(s"ElasticNet mixing parameter. For alpha = 0, the penalty is 
an L2 penalty. " +
    +        s"For alpha = 1, it is an L1 penalty. For 0 < alpha < 1, the 
penalty is a combination of " +
    +        s"L1 and L2, default: ${defaultParams.elasticNetParam}")
    +        .action((x, c) => c.copy(elasticNetParam = x))
    +      opt[Int]("maxIter")
    +        .text(s"maximal number of iterations, default: 
${defaultParams.maxIter}")
    --- End diff --
    
    I'd say "maximum" since "maximal" often implies there are multiple maxima.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to