You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by zhengruifeng <gi...@git.apache.org> on 2017/08/30 02:05:37 UTC

[GitHub] spark pull request #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer inc...

GitHub user zhengruifeng opened a pull request:

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

    [SPARK-20711][ML]MultivariateOnlineSummarizer incorrect min/max for NaN value

    ## What changes were proposed in this pull request?
    
    current impl of min/max ignore `NaN`
    for a column only containing `NaN`, `Double.MaxValue` will be returned for `min` and `Double.MinValue` will be returned for `max`
    
    min/max for column containing `NaN` should return `NaN`
    
    ## How was this patch tested?
    existing tests


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

    $ git pull https://github.com/zhengruifeng/spark min_max

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

    https://github.com/apache/spark/pull/19084.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 #19084
    
----
commit f6c75b918dd4fd8848fc22989309e317fc101dc6
Author: Zheng RuiFeng <ru...@foxmail.com>
Date:   2017-08-30T02:01:55Z

    create pr

----


---
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 #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

    https://github.com/apache/spark/pull/19084
  
    **[Test build #81240 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/81240/testReport)** for PR 19084 at commit [`f6c75b9`](https://github.com/apache/spark/commit/f6c75b918dd4fd8848fc22989309e317fc101dc6).
     * This patch **fails Spark unit 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 #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

    https://github.com/apache/spark/pull/19084
  
    **[Test build #84466 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84466/testReport)** for PR 19084 at commit [`80df3c6`](https://github.com/apache/spark/commit/80df3c69ac58ae5f4190b0b62dd2bdb1cef15260).
     * 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 pull request #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Sum...

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

    https://github.com/apache/spark/pull/19084#discussion_r195429701
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/MinMaxScaler.scala ---
    @@ -117,11 +113,56 @@ class MinMaxScaler @Since("1.5.0") (@Since("1.5.0") override val uid: String)
       @Since("2.0.0")
       override def fit(dataset: Dataset[_]): MinMaxScalerModel = {
         transformSchema(dataset.schema, logging = true)
    -    val input: RDD[OldVector] = dataset.select($(inputCol)).rdd.map {
    -      case Row(v: Vector) => OldVectors.fromML(v)
    +
    --- End diff --
    
    Rather than copy all that code, I wonder if that utility class can just be modified to selectively handle NaN differently?  


---

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


[GitHub] spark issue #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

    https://github.com/apache/spark/pull/19084
  
    @srowen Could you please give a final review? Thanks


---

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


[GitHub] spark pull request #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Sum...

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

    https://github.com/apache/spark/pull/19084#discussion_r154897263
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/MinMaxScaler.scala ---
    @@ -117,11 +113,56 @@ class MinMaxScaler @Since("1.5.0") (@Since("1.5.0") override val uid: String)
       @Since("2.0.0")
       override def fit(dataset: Dataset[_]): MinMaxScalerModel = {
         transformSchema(dataset.schema, logging = true)
    -    val input: RDD[OldVector] = dataset.select($(inputCol)).rdd.map {
    -      case Row(v: Vector) => OldVectors.fromML(v)
    +
    --- End diff --
    
    `Statistics.colStats(input)` uses `MultivariateOnlineSummarizer` to compute the max/min which will ignore `Double.NaN`.
    
    I change the behavior of NaN handling in `MultivariateOnlineSummarizer` in this PR, so I have to make another impl of `MinMaxScaler` to keep it behavior.



---

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


[GitHub] spark issue #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

    https://github.com/apache/spark/pull/19084
  
    Merged build finished. Test FAILed.


---
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 #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

    https://github.com/apache/spark/pull/19084
  
    I tend to agree, because this is how the JDK and Scala behave too. Numpy as well. But not Python, curiously.
    
    I also agree that the existing "handleInvalid" functionality probably needs to be considered. I'm not as sure how that's supposed to interact with this.


---
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 #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

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


---
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 #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

    https://github.com/apache/spark/pull/19084
  
    `MinMaxScalerSuite` fails because `MinMaxScaler` need the behavior of ignoring `NaN`. So I think there are 2 options:
    1, `MultivariateOnlineSummarizer/Summarizer` support param `handleInvaild`;
    2, use aggregator instead of `MultivariateOnlineSummarizer` in `MinMaxScaler`



---
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 #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

    https://github.com/apache/spark/pull/19084
  
    **[Test build #84466 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84466/testReport)** for PR 19084 at commit [`80df3c6`](https://github.com/apache/spark/commit/80df3c69ac58ae5f4190b0b62dd2bdb1cef15260).


---

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


[GitHub] spark issue #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

    https://github.com/apache/spark/pull/19084
  
    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 #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

    https://github.com/apache/spark/pull/19084
  
    ping @WeichenXu123 @srowen 


---
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 #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Sum...

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

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


---

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


[GitHub] spark issue #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

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


---
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 #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Summarizer...

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

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


---

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


[GitHub] spark pull request #19084: [SPARK-20711][ML]MultivariateOnlineSummarizer/Sum...

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

    https://github.com/apache/spark/pull/19084#discussion_r154894819
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/MinMaxScaler.scala ---
    @@ -117,11 +113,56 @@ class MinMaxScaler @Since("1.5.0") (@Since("1.5.0") override val uid: String)
       @Since("2.0.0")
       override def fit(dataset: Dataset[_]): MinMaxScalerModel = {
         transformSchema(dataset.schema, logging = true)
    -    val input: RDD[OldVector] = dataset.select($(inputCol)).rdd.map {
    -      case Row(v: Vector) => OldVectors.fromML(v)
    +
    --- End diff --
    
    Is this code a copy of  Statistics.colStats(input) ? how does it differ?


---

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