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

    https://github.com/apache/spark/pull/14826#discussion_r76459471
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala ---
    @@ -763,11 +764,13 @@ private[python] class PythonMLLibAPI extends 
Serializable {
           maxBins = maxBins,
           categoricalFeaturesInfo = categoricalFeaturesInfo.asScala.toMap)
         val cached = data.rdd.persist(StorageLevel.MEMORY_AND_DISK)
    +    // Only done because methods below want an int, not an optional Long
    +    val intSeed = getSeedOrDefault(seed).toInt
    --- End diff --
    
    This is kind of odd, but I see why you have it.  Maybe it would be a little 
better to do 
    `val intSeed = if (seed == null) Utils.random.nextInt else seed.toInt`
    
    That way it would avoid a slightly biased random Int


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