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

    https://github.com/apache/spark/pull/12660#discussion_r60925223
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/recommendation/ALS.scala 
---
    @@ -153,12 +153,42 @@ private[recommendation] trait ALSParams extends 
ALSModelParams with HasMaxIter w
       /** @group getParam */
       def getNonnegative: Boolean = $(nonnegative)
     
    +  /**
    +   * Param for StorageLevel for intermediate RDDs. Pass in a string 
representation of
    +   * [[StorageLevel]]. Cannot be "NONE".
    +   * Default: "MEMORY_AND_DISK".
    +   *
    +   * @group expertParam
    +   */
    +  val intermediateRDDStorageLevel = new Param[String](this, 
"intermediateRDDStorageLevel",
    +    "StorageLevel for intermediate RDDs. Cannot be 'NONE'. Default: 
'MEMORY_AND_DISK'.",
    +    (s: String) => Try(StorageLevel.fromString(s)).isSuccess && s != 
"NONE")
    --- End diff --
    
    `StorageLevel.fromString` will only success if the input matches one of the 
coded storage levels which is valid by definition. I think the `isValid` method 
is used elsewhere throughout core for other purposes.
    
    If it doesn't match it does happen to throw the same 
`IllegalArgumentException`, so either approach would work. But all we need to 
do here is ensure the string input can be parsed into a `StorageLevel`


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