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

    https://github.com/apache/spark/pull/3397#discussion_r20708251
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala ---
    @@ -74,13 +74,27 @@ class PythonMLLibAPI extends Serializable {
           learner: GeneralizedLinearAlgorithm[_ <: GeneralizedLinearModel],
           data: JavaRDD[LabeledPoint],
           initialWeights: Vector): JList[Object] = {
    -    // Disable the uncached input warning because 'data' is a deliberately 
uncached MappedRDD.
    -    learner.disableUncachedWarning()
    -    val model = learner.run(data.rdd, initialWeights)
    +    val model = 
learner.run(data.rdd.persist(StorageLevel.MEMORY_AND_DISK), initialWeights)
         List(model.weights, model.intercept).map(_.asInstanceOf[Object]).asJava
       }
     
       /**
    +   * Return the Updater from string
    +   */
    +  def getUpdateFromString(regType: String): Updater = {
    +    if (regType == "l2") {
    +      new SquaredL2Updater
    +    } else if (regType == "l1") {
    +      new L1Updater
    +    } else if (regType == null || regType == "none") {
    +      new SimpleUpdater
    +    } else {
    +      throw new java.lang.IllegalArgumentException("Invalid value for 
'regType' parameter."
    --- End diff --
    
    `java.lang.` is not necessary


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

Reply via email to