You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Matias Rotenberg (JIRA)" <ji...@apache.org> on 2019/02/06 17:42:00 UTC

[jira] [Comment Edited] (SPARK-17086) QuantileDiscretizer throws InvalidArgumentException (parameter splits given invalid value) on valid data

    [ https://issues.apache.org/jira/browse/SPARK-17086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16761953#comment-16761953 ] 

Matias Rotenberg edited comment on SPARK-17086 at 2/6/19 5:41 PM:
------------------------------------------------------------------

I seem to be running into this exact issue in 2.2.0 when using QuantileDiscretizer:

IllegalArgumentException: u'Bucketizer_467c983fd201c1561cf3 parameter splits given invalid value [-Infinity,-1.0,-1.0,-1.0,-0.999999999996,-0.999999994038,-0.999998539337,-0.993442759767,0.997389694724,0.999999999505,Infinity].

 

Could it be that the change was not ported to newer versions?

 

edit:

When I getSplits there are actually no duplicate values:\

splits =  
[-inf, -1.0, -0.999999999999999, -0.9999999999999638, -0.9999999999962722, -0.9999999940383268, -0.9999985393371443, -0.9934427597674274, 0.9973896947239832, 0.9999999995050777, inf]
 
Could it be a matter of precision?
 


was (Author: matias rotenberg):
I seem to be running into this exact issue in 2.2.0 when using QuantileDiscretizer:

IllegalArgumentException: u'Bucketizer_467c983fd201c1561cf3 parameter splits given invalid value [-Infinity,-1.0,-1.0,-1.0,-0.999999999996,-0.999999994038,-0.999998539337,-0.993442759767,0.997389694724,0.999999999505,Infinity].

 

Could it be that the change was not ported to newer versions?

 

> QuantileDiscretizer throws InvalidArgumentException (parameter splits given invalid value) on valid data
> --------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-17086
>                 URL: https://issues.apache.org/jira/browse/SPARK-17086
>             Project: Spark
>          Issue Type: Bug
>          Components: ML
>    Affects Versions: 2.0.0
>            Reporter: Barry Becker
>            Assignee: Vincent
>            Priority: Major
>             Fix For: 2.0.1, 2.1.0
>
>         Attachments: titanic.csv
>
>
> I discovered this bug when working with a build from the master branch (which I believe is 2.1.0). This used to work fine when running spark 1.6.2.
> I have a dataframe with an "intData" column that has values like 
> {code}
> 1 3 2 1 1 2 3 2 2 2 1 3
> {code}
> I have a stage in my pipeline that uses the QuantileDiscretizer to produce equal weight splits like this
> {code}
> new QuantileDiscretizer()
>         .setInputCol("intData")
>         .setOutputCol("intData_bin")
>         .setNumBuckets(10)
>         .fit(df)
> {code}
> But when that gets run it (incorrectly) throws this error:
> {code}
> parameter splits given invalid value [-Infinity, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, Infinity]
> {code}
> I don't think that there should be duplicate splits generated should there be?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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