You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by hhbyyh <gi...@git.apache.org> on 2016/06/22 11:12:44 UTC

[GitHub] spark pull request #13841: [SPARK-16130][ML] model loading backward compatib...

GitHub user hhbyyh opened a pull request:

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

    [SPARK-16130][ML] model loading backward compatibility for ml.classfication.LogisticRegression

    ## What changes were proposed in this pull request?
    jira: https://issues.apache.org/jira/browse/SPARK-16130
    model loading backward compatibility for ml.classfication.LogisticRegression
    
    
    ## How was this patch tested?
    existing ut and manual test for loading old models.
    


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

    $ git pull https://github.com/hhbyyh/spark lrcomp

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

    https://github.com/apache/spark/pull/13841.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 #13841
    
----
commit 4f1f0e034c517b7732819860e64c3dc847c8fbfa
Author: Yuhao Yang <hh...@gmail.com>
Date:   2016-06-22T11:09:09Z

    load for old models

----


---
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 #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61028/
    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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    **[Test build #61028 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61028/consoleFull)** for PR 13841 at commit [`4540967`](https://github.com/apache/spark/commit/45409672050b965b3e9876614a4f8b2c2af7df8d).
     * 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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    **[Test build #61067 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61067/consoleFull)** for PR 13841 at commit [`4f76ed0`](https://github.com/apache/spark/commit/4f76ed0b73455504700922043c17aed572ebcf29).


---
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 #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61112/
    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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    **[Test build #61067 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61067/consoleFull)** for PR 13841 at commit [`4f76ed0`](https://github.com/apache/spark/commit/4f76ed0b73455504700922043c17aed572ebcf29).
     * 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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    **[Test build #61025 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61025/consoleFull)** for PR 13841 at commit [`4f1f0e0`](https://github.com/apache/spark/commit/4f1f0e034c517b7732819860e64c3dc847c8fbfa).


---
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 #13841: [SPARK-16130][ML] model loading backward compatib...

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

    https://github.com/apache/spark/pull/13841#discussion_r68088372
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala ---
    @@ -674,12 +674,13 @@ object LogisticRegressionModel extends MLReadable[LogisticRegressionModel] {
     
           val dataPath = new Path(path, "data").toString
           val data = sparkSession.read.format("parquet").load(dataPath)
    -        .select("numClasses", "numFeatures", "intercept", "coefficients").head()
    +        .select("numClasses", "numFeatures", "intercept", "coefficients")
    +      val row = MLUtils.convertVectorColumnsToML(data, "coefficients").head()
    --- End diff --
    
    I think we should call convert vector columns first and then call `select` to ensure the ordering of columns. There is no contact on keeping the column ordering between mappings.


---
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 #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61025/
    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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    Thanks for the review @mengxr . Updated according to the comments.


---
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 #13841: [SPARK-16130][ML] model loading backward compatib...

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

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


---
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 #13841: [SPARK-16130][ML] model loading backward compatib...

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

    https://github.com/apache/spark/pull/13841#discussion_r68191189
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala ---
    @@ -674,12 +674,12 @@ object LogisticRegressionModel extends MLReadable[LogisticRegressionModel] {
     
           val dataPath = new Path(path, "data").toString
           val data = sparkSession.read.format("parquet").load(dataPath)
    -        .select("numClasses", "numFeatures", "intercept", "coefficients").head()
    +
           // We will need numClasses, numFeatures in the future for multinomial logreg support.
    -      // val numClasses = data.getInt(0)
    -      // val numFeatures = data.getInt(1)
    -      val intercept = data.getDouble(2)
    -      val coefficients = data.getAs[Vector](3)
    +      val Row(numClasses: Int, numFeatures: Int, intercept: Double, coefficients: Vector) =
    +        MLUtils.convertVectorColumnsToML(data, "coefficients")
    +        .select("numClasses", "numFeatures", "intercept", "coefficients")
    --- End diff --
    
    should have two more spaces


---
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 #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61067/
    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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    **[Test build #61112 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61112/consoleFull)** for PR 13841 at commit [`1243c16`](https://github.com/apache/spark/commit/1243c16dbc9487280660b08b2cf0d515e36903c3).
     * 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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    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 issue #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    **[Test build #61028 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61028/consoleFull)** for PR 13841 at commit [`4540967`](https://github.com/apache/spark/commit/45409672050b965b3e9876614a4f8b2c2af7df8d).


---
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 #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    **[Test build #61112 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61112/consoleFull)** for PR 13841 at commit [`1243c16`](https://github.com/apache/spark/commit/1243c16dbc9487280660b08b2cf0d515e36903c3).


---
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 #13841: [SPARK-16130][ML] model loading backward compatibility f...

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

    https://github.com/apache/spark/pull/13841
  
    **[Test build #61025 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61025/consoleFull)** for PR 13841 at commit [`4f1f0e0`](https://github.com/apache/spark/commit/4f1f0e034c517b7732819860e64c3dc847c8fbfa).
     * This patch passes all tests.
     * This patch **does not merge 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 #13841: [SPARK-16130][ML] model loading backward compatib...

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

    https://github.com/apache/spark/pull/13841#discussion_r68088554
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala ---
    @@ -674,12 +674,13 @@ object LogisticRegressionModel extends MLReadable[LogisticRegressionModel] {
     
           val dataPath = new Path(path, "data").toString
           val data = sparkSession.read.format("parquet").load(dataPath)
    -        .select("numClasses", "numFeatures", "intercept", "coefficients").head()
    +        .select("numClasses", "numFeatures", "intercept", "coefficients")
    +      val row = MLUtils.convertVectorColumnsToML(data, "coefficients").head()
    --- End diff --
    
    Btw, if we are going to update this PR, it is more readable to write
    
    ~~~scala
    val Row(numClasses: Int, numFeatures: Int, intercept: Double, coefficients: Vector) = data.head()
    ~~~


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