You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by mgaido91 <gi...@git.apache.org> on 2018/08/11 10:17:27 UTC

[GitHub] spark pull request #22076: [SPARK-25090][ML] Enforce implicit type coercion ...

GitHub user mgaido91 opened a pull request:

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

    [SPARK-25090][ML] Enforce implicit type coercion in ParamGridBuilder

    ## What changes were proposed in this pull request?
    
    When the grid of the parameters is created in `ParamGridBuilder`, the implicit type coercion is not enforced. So using an integer in the list of parameters to set for a parameter accepting a double can cause a class cast exception.
    
    The PR proposes to enforce the type coercion when building the parameters.
    
    ## How was this patch tested?
    
    added UT

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

    $ git pull https://github.com/mgaido91/spark SPARK-25090

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

    https://github.com/apache/spark/pull/22076.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 #22076
    
----
commit b5a59fdc71226323008561053cf918e079934f0a
Author: Marco Gaido <ma...@...>
Date:   2018-08-11T10:07:31Z

    [SPARK-25090][ML] Enforce implicit type coercion in ParamGridBuilder

----


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    **[Test build #94609 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/94609/testReport)** for PR 22076 at commit [`b5a59fd`](https://github.com/apache/spark/commit/b5a59fdc71226323008561053cf918e079934f0a).


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    **[Test build #94647 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/94647/testReport)** for PR 22076 at commit [`1727bf0`](https://github.com/apache/spark/commit/1727bf0c467edec0646e5055f6348813ac33671a).


---

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


[GitHub] spark pull request #22076: [SPARK-25090][ML] Enforce implicit type coercion ...

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

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


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2077/
    Test PASSed.


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    **[Test build #94609 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/94609/testReport)** for PR 22076 at commit [`b5a59fd`](https://github.com/apache/spark/commit/b5a59fdc71226323008561053cf918e079934f0a).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    LGTM


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

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


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    Merged to master.


---

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


[GitHub] spark pull request #22076: [SPARK-25090][ML] Enforce implicit type coercion ...

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

    https://github.com/apache/spark/pull/22076#discussion_r209454605
  
    --- Diff: python/pyspark/ml/tests.py ---
    @@ -950,6 +950,13 @@ def test_fit_maximize_metric(self):
                              "Best model should have zero induced error")
             self.assertEqual(1.0, bestModelMetric, "Best model has R-squared of 1")
     
    +    def test_param_grid_type_coercion(self):
    +        lr = LogisticRegression(maxIter=10)
    +        paramGrid = ParamGridBuilder().addGrid(lr.regParam, [0.5, 1]).build()
    +        for param in paramGrid:
    +            for v in param.values():
    +                assert(type(v) is float)
    --- End diff --
    
    nit: `type(v) == float `


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    cc @BryanCutler @HyukjinKwon @holdenk 


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2101/
    Test PASSed.


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    **[Test build #94647 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/94647/testReport)** for PR 22076 at commit [`1727bf0`](https://github.com/apache/spark/commit/1727bf0c467edec0646e5055f6348813ac33671a).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

    https://github.com/apache/spark/pull/22076
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #22076: [SPARK-25090][ML] Enforce implicit type coercion in Para...

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

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


---

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