You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by MLnick <gi...@git.apache.org> on 2016/06/23 06:53:06 UTC

[GitHub] spark pull request #13745: [Spark-15997][DOC][ML] Update user guide for Hash...

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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org