You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by Shanshan-IC <gi...@git.apache.org> on 2017/07/10 09:25:57 UTC

[GitHub] spark pull request #18585: SPARK-21359

GitHub user Shanshan-IC opened a pull request:

    https://github.com/apache/spark/pull/18585

    SPARK-21359

    ## What changes were proposed in this pull request?
    
    As described in https://issues.apache.org/jira/browse/SPARK-21359
    
    add new functions for frequency discretizer transformation
    
    ## How was this patch tested?
    test example: 
    val data = Array((0, 18.0), (1, 19.0), (2, 8.0), (3, 5.0), (4, 2.2), (5, 1.0), (6, 9.1), (7, 10.1), (8, 1.1), (9, 16.0), (10, 20.0), (11, 20.0)) 
        val df = spark.createDataFrame(data).toDF("id", "hour") 
        val frequency = new FrequencyDiscretizer() 
          .setInputCol("hour") 
          .setOutputCol("result") 
          .setNumBuckets(4) 
    
        val result = frequency.fit(df).transform(df) 
        result.show() 
    
    You will get: 
    +---+----+------+ 
    | id|hour|result| 
    +---+----+------+ 
    | 0|18.0| 2.0| 
    | 1|19.0| 3.0| 
    | 2| 8.0| 1.0| 
    | 3| 5.0| 1.0| 
    | 4| 2.2| 0.0| 
    | 5| 1.0| 0.0| 
    | 6| 9.1| 1.0| 
    | 7|10.1| 2.0| 
    | 8| 1.1| 0.0| 
    | 9|16.0| 2.0| 
    | 10|20.0| 3.0| 
    | 11|20.0| 3.0| 
    +---+----+------+ 
    
    Please review http://spark.apache.org/contributing.html before opening a pull request.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Shanshan-IC/spark mybranch

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/18585.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #18585
    
----
commit ba99deab14189aab69f38a8ebc5e5d3939dec1eb
Author: fushanshan <fu...@qiyi.com>
Date:   2017-07-10T09:14:05Z

    frequencydiscretizer

----


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


[GitHub] spark issue #18585: SPARK-21359

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/18585
  
    I'd ask you to close this and back up and discuss what this is about on the JIRA first. I don't understand what this is intended to do.


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


[GitHub] spark issue #18585: SPARK-21359

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18585
  
    Can one of the admins verify this patch?


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


[GitHub] spark pull request #18585: SPARK-21359

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/18585


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