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

    https://github.com/apache/spark/pull/13745#discussion_r68183527
  
    --- Diff: examples/src/main/python/ml/quantile_discretizer_example.py ---
    @@ -29,11 +29,12 @@
         # $example on$
         data = [(0, 18.0,), (1, 19.0,), (2, 8.0,), (3, 5.0,), (4, 2.2,)]
         dataFrame = spark.createDataFrame(data, ["id", "hour"])
    -
    -    # Note that we compute exact quantiles here by setting `relativeError` 
to 0 for
    -    # illustrative purposes, however in most cases the default parameter 
value should suffice
    -    discretizer = QuantileDiscretizer(numBuckets=3, inputCol="hour", 
outputCol="result",
    -                                      relativeError=0)
    +    # $example off$
    +    # Output of QuantileDiscretizer for such small datasets differ wrt 
underlying cores.
    +    # Allocating single partition for the dataframe helps with consistent 
results.
    +    .repartition(1)
    --- End diff --
    
    Also can we just call it `df` to match the other examples (i just noticed 
that)


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