Oliver Pierson created SPARK-13600:
--------------------------------------
Summary: Incorrect number of buckets in QuantileDiscretizer
Key: SPARK-13600
URL: https://issues.apache.org/jira/browse/SPARK-13600
Project: Spark
Issue Type: Bug
Components: MLlib
Affects Versions: 1.6.0, 2.0.0
Reporter: Oliver Pierson
Under certain circumstances, QuantileDiscretizer fails to calculate the correct
splits resulting in an incorrect number of buckets/bins.
E.g.
val df = sc.parallelize(1.0 to 10.0 by 1.0).map(Tuple1.apply).toDF("x")
val discretizer = new
QuantileDiscretizer().setInputCol("x").setOutputCol("y").setNumBuckets(5)
discretizer.fit(df).getSplits
gives:
Array(-Infinity, 2.0, 4.0, 6.0, 8.0, 10.0, Infinity)
which corresponds to 6 buckets (not 5).
The problem appears to be in the QuantileDiscretizer.findSplitsCandidates
method.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]