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

    https://github.com/apache/spark/pull/13745#discussion_r68183471
  
    --- 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 --
    
    Did you check this works? I think it will throw `SyntaxError`. You may need 
to do `dataFrame = dataFrame..repartition(1)`


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