You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by yinxusen <gi...@git.apache.org> on 2016/03/18 01:33:22 UTC

[GitHub] spark pull request: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

GitHub user yinxusen opened a pull request:

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

    [SPARK-13993][PySpark] Add pyspark Rformula/RforumlaModel save/load

    ## What changes were proposed in this pull request?
    
    https://issues.apache.org/jira/browse/SPARK-13993
    
    ## How was this patch tested?
    
    doctest


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

    $ git pull https://github.com/yinxusen/spark SPARK-13993

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

    https://github.com/apache/spark/pull/11807.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 #11807
    
----
commit cf596346e2f5e333902e9e48a895040d3ec62409
Author: Xusen Yin <yi...@gmail.com>
Date:   2016-03-18T00:31:46Z

    add pyspark rformula save/load

----


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11807#discussion_r56726804
  
    --- Diff: python/pyspark/ml/feature.py ---
    @@ -2385,7 +2385,31 @@ class RFormula(JavaEstimator, HasFeaturesCol, HasLabelCol):
         |0.0|0.0|  a|[0.0,1.0]|  0.0|
         +---+---+---+---------+-----+
         ...
    -    >>> rf.fit(df, {rf.formula: "y ~ . - s"}).transform(df).show()
    +    >>> model = rf.fit(df, {rf.formula: "y ~ . - s"})
    --- End diff --
    
    How about reusing the fit model from above?


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/11807#issuecomment-198638752
  
    **[Test build #53602 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/53602/consoleFull)** for PR 11807 at commit [`d31bb3f`](https://github.com/apache/spark/commit/d31bb3f9cb616805ff48cce64d0d0f136cbd5639).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

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

    https://github.com/apache/spark/pull/11807#issuecomment-198147477
  
    Merged build finished. Test PASSed.


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by yinxusen <gi...@git.apache.org>.
Github user yinxusen commented on the pull request:

    https://github.com/apache/spark/pull/11807#issuecomment-198147707
  
    @jkbradley This is a follow-up for https://github.com/apache/spark/pull/9884


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/11807#issuecomment-198145393
  
    **[Test build #53487 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/53487/consoleFull)** for PR 11807 at commit [`cf59634`](https://github.com/apache/spark/commit/cf596346e2f5e333902e9e48a895040d3ec62409).


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by yinxusen <gi...@git.apache.org>.
Github user yinxusen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11807#discussion_r56727429
  
    --- Diff: python/pyspark/ml/feature.py ---
    @@ -2385,7 +2385,31 @@ class RFormula(JavaEstimator, HasFeaturesCol, HasLabelCol):
         |0.0|0.0|  a|[0.0,1.0]|  0.0|
         +---+---+---+---------+-----+
         ...
    -    >>> rf.fit(df, {rf.formula: "y ~ . - s"}).transform(df).show()
    +    >>> model = rf.fit(df, {rf.formula: "y ~ . - s"})
    +    >>> model.transform(df).show()
    +    +---+---+---+--------+-----+
    +    |  y|  x|  s|features|label|
    +    +---+---+---+--------+-----+
    +    |1.0|1.0|  a|   [1.0]|  1.0|
    +    |0.0|2.0|  b|   [2.0]|  0.0|
    +    |0.0|0.0|  a|   [0.0]|  0.0|
    +    +---+---+---+--------+-----+
    +    ...
    +    >>> rFormulaPath = temp_path + "/rFormula"
    +    >>> rf.save(rFormulaPath)
    +    >>> loadedRF = RFormula.load(rFormulaPath)
    +    >>> loadedRF.getFormula() == rf.getFormula()
    +    True
    +    >>> loadedRF.getFeaturesCol() == rf.getFeaturesCol()
    +    True
    +    >>> loadedRF.getLabelCol() == rf.getLabelCol()
    +    True
    +    >>> modelPath = temp_path + "/rFormula-model"
    --- End diff --
    
    Sure


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:

    https://github.com/apache/spark/pull/11807#issuecomment-199049329
  
    LGTM
    Merging with master


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

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

    https://github.com/apache/spark/pull/11807#issuecomment-198638916
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/53602/
    Test PASSed.


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/11807#issuecomment-198634702
  
    **[Test build #53602 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/53602/consoleFull)** for PR 11807 at commit [`d31bb3f`](https://github.com/apache/spark/commit/d31bb3f9cb616805ff48cce64d0d0f136cbd5639).


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11807#discussion_r56726812
  
    --- Diff: python/pyspark/ml/feature.py ---
    @@ -2385,7 +2385,31 @@ class RFormula(JavaEstimator, HasFeaturesCol, HasLabelCol):
         |0.0|0.0|  a|[0.0,1.0]|  0.0|
         +---+---+---+---------+-----+
         ...
    -    >>> rf.fit(df, {rf.formula: "y ~ . - s"}).transform(df).show()
    +    >>> model = rf.fit(df, {rf.formula: "y ~ . - s"})
    +    >>> model.transform(df).show()
    +    +---+---+---+--------+-----+
    +    |  y|  x|  s|features|label|
    +    +---+---+---+--------+-----+
    +    |1.0|1.0|  a|   [1.0]|  1.0|
    +    |0.0|2.0|  b|   [2.0]|  0.0|
    +    |0.0|0.0|  a|   [0.0]|  0.0|
    +    +---+---+---+--------+-----+
    +    ...
    +    >>> rFormulaPath = temp_path + "/rFormula"
    +    >>> rf.save(rFormulaPath)
    +    >>> loadedRF = RFormula.load(rFormulaPath)
    +    >>> loadedRF.getFormula() == rf.getFormula()
    +    True
    +    >>> loadedRF.getFeaturesCol() == rf.getFeaturesCol()
    +    True
    +    >>> loadedRF.getLabelCol() == rf.getLabelCol()
    +    True
    +    >>> modelPath = temp_path + "/rFormula-model"
    --- End diff --
    
    Use dir "rFormulaModel"


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

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

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


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by yinxusen <gi...@git.apache.org>.
Github user yinxusen commented on the pull request:

    https://github.com/apache/spark/pull/11807#issuecomment-198144550
  
    test it please


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by yinxusen <gi...@git.apache.org>.
Github user yinxusen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11807#discussion_r56727407
  
    --- Diff: python/pyspark/ml/feature.py ---
    @@ -2385,7 +2385,31 @@ class RFormula(JavaEstimator, HasFeaturesCol, HasLabelCol):
         |0.0|0.0|  a|[0.0,1.0]|  0.0|
         +---+---+---+---------+-----+
         ...
    -    >>> rf.fit(df, {rf.formula: "y ~ . - s"}).transform(df).show()
    +    >>> model = rf.fit(df, {rf.formula: "y ~ . - s"})
    --- End diff --
    
    Do you mean use the `rf.fit(df)` other than this `rf.fit(df, {rf.formula: "y ~ . - s"})` ?


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11807#discussion_r56773733
  
    --- Diff: python/pyspark/ml/feature.py ---
    @@ -2385,7 +2385,31 @@ class RFormula(JavaEstimator, HasFeaturesCol, HasLabelCol):
         |0.0|0.0|  a|[0.0,1.0]|  0.0|
         +---+---+---+---------+-----+
         ...
    -    >>> rf.fit(df, {rf.formula: "y ~ . - s"}).transform(df).show()
    +    >>> model = rf.fit(df, {rf.formula: "y ~ . - s"})
    --- End diff --
    
    Oh, sorry, I originally thought this was a new fit() being added, and I wanted to avoid unnecessary model fitting.  I now see it was already there, so it's fine either way.


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

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

    https://github.com/apache/spark/pull/11807#issuecomment-198638912
  
    Merged build finished. Test PASSed.


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

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

    https://github.com/apache/spark/pull/11807#issuecomment-198147481
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/53487/
    Test PASSed.


---
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: [SPARK-13993][PySpark] Add pyspark Rformula/Rf...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/11807#issuecomment-198147398
  
    **[Test build #53487 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/53487/consoleFull)** for PR 11807 at commit [`cf59634`](https://github.com/apache/spark/commit/cf596346e2f5e333902e9e48a895040d3ec62409).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class RFormula(JavaEstimator, HasFeaturesCol, HasLabelCol, MLReadable, MLWritable):`
      * `class RFormulaModel(JavaModel, MLReadable, MLWritable):`


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