You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by leonfl <gi...@git.apache.org> on 2017/01/06 07:43:16 UTC

[GitHub] spark pull request #16486: [SPARK-13610][ML] Create a Transformer to disasse...

GitHub user leonfl opened a pull request:

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

    [SPARK-13610][ML] Create a Transformer to disassemble vectors in Data\u2026

    JIRA Issue: https://issues.apache.org/jira/browse/SPARK-13610
    
    ## What changes were proposed in this pull request?
    
    Add a VectorDisassembler used for disassemble the vector field to single fields.
    
    ## How was this patch tested?
    
    Unit tests have added into ml for this feature.


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

    $ git pull https://github.com/leonfl/spark master

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

    https://github.com/apache/spark/pull/16486.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 #16486
    
----
commit 3076617de5d957f26cb522038a3b268d19033b89
Author: LEI FAN <fa...@cn.ibm.com>
Date:   2017-01-06T07:38:37Z

    [SPARK-13610][ML] Create a Transformer to disassemble vectors in DataFrames

----


---
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 #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

    https://github.com/apache/spark/pull/16486
  
    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 issue #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

    https://github.com/apache/spark/pull/16486
  
    I don't think this is worth adding. It's pretty easy to pull out a single fiedl from a vector already.


---
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 #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

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


---

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


[GitHub] spark pull request #16486: [SPARK-13610][ML] Create a Transformer to disasse...

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

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


---

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


[GitHub] spark issue #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

    https://github.com/apache/spark/pull/16486
  
    @jkbradley, Could you also help to check this patch cause you are familiar with this defect, Thanks.


---
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 #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

    https://github.com/apache/spark/pull/16486
  
    @mrjrdnthms , this is implemented by UDF, which will run a little bit slower, but easy to use.
    If you want it run faster, you can implement it using mappatition and row iterator instead of udf.
    That implementation will reduce the running time a lot.


---
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 #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

    https://github.com/apache/spark/pull/16486
  
    It's a method like VectorAssembler, which make user easy to handle single fields and vector field.
    Pull out a single field is easy, but for all single fields in a vector, it still need some code by users. This Transformer will make user easy understand and use, right?


---
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 #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

    https://github.com/apache/spark/pull/16486
  
    @leonfl The python udf is too slow for my task. By "mappatition and row iterator" do you mean doing the transformation on the RDD directly instead of the dataframe? Sorry for the basic question. I am new to spark. And thanks for help.


---
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 #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

    https://github.com/apache/spark/pull/16486
  
    I could use this. I have udf to pick out single values I want but my implementation is slow: here is my python udf:
    `probTrue_udf = udf(lambda value: value[1].item(), FloatType())`
    I was hoping there would be a lower level api that did the disassemble transformation quickly.


---
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 #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

    https://github.com/apache/spark/pull/16486
  
    @mrjrdnthms ,Yes, your understand is correct, in scala it like this:
    
    ```
        val rows: RDD[Row] = df.rdd.map(
          rowIn => {
            // handle the rowIn and return a Row
          }
        )
        val newDF = df.sqlContext.createDataFrame(rows, /*create the newDF schema*/)
    ```


---
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 #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

    https://github.com/apache/spark/pull/16486
  
    Was this ever implemented?


---

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


[GitHub] spark issue #16486: [SPARK-13610][ML] Create a Transformer to disassemble ve...

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

    https://github.com/apache/spark/pull/16486
  
    @mengxr, could you help to check this patch? Thanks


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