GitHub user keypointt opened a pull request:

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

    [SPARK-17026][MLlib][Tests] remove identical values substraction

    https://issues.apache.org/jira/browse/SPARK-17026
    
    ## What changes were proposed in this pull request?
    
    I'm not sure if this is a valid patch, just submitting for the record.
    
    Got warning when building project:
    ```
    [warn] 
/home/jenkins/workspace/SparkPullRequestBuilder/mllib/src/test/scala/org/apache/spark/mllib/evaluation/MulticlassMetricsSuite.scala:74:
 value precision in class MulticlassMetrics is deprecated: Use accuracy.
    [warn]    assert(math.abs(metrics.accuracy - metrics.precision) < delta)
    [warn]                                                ^
    [warn] 
/home/jenkins/workspace/SparkPullRequestBuilder/mllib/src/test/scala/org/apache/spark/mllib/evaluation/MulticlassMetricsSuite.scala:75:
 value recall in class MulticlassMetrics is deprecated: Use accuracy.
    [warn]    assert(math.abs(metrics.accuracy - metrics.recall) < delta)
    [warn]                                                ^
    [warn] 
/home/jenkins/workspace/SparkPullRequestBuilder/mllib/src/test/scala/org/apache/spark/mllib/evaluation/MulticlassMetricsSuite.scala:76:
 value fMeasure in class MulticlassMetrics is deprecated: Use accuracy.
    [warn]    assert(math.abs(metrics.accuracy - metrics.fMeasure) < delta)
    [warn]                                                ^
    ```
    
    And `precision` and `recall` and `fMeasure` are all referencing to 
`accuracy`. So in this PR I just removed these 3 assert.
    ```
        assert(math.abs(metrics.accuracy - metrics.precision) < delta)
        assert(math.abs(metrics.accuracy - metrics.recall) < delta)
        assert(math.abs(metrics.accuracy - metrics.fMeasure) < delta)
    ```
    
    ```
      /**
       * Returns precision
       */
      @Since("1.1.0")
      @deprecated("Use accuracy.", "2.0.0")
      lazy val precision: Double = accuracy
    
    
      /**
       * Returns recall
       * (equals to precision for multiclass classifier
       * because sum of all false positives is equal to sum
       * of all false negatives)
       */
      @Since("1.1.0")
      @deprecated("Use accuracy.", "2.0.0")
      lazy val recall: Double = accuracy
    
    
      /**
       * Returns f-measure
       * (equals to precision and recall because precision equals recall)
       */
      @Since("1.1.0")
      @deprecated("Use accuracy.", "2.0.0")
      lazy val fMeasure: Double = accuracy
    ```
    
    
    
    ## How was this patch tested?
    
    Tested manually on local laptop
    


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

    $ git pull https://github.com/keypointt/spark SPARK-17026

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

    https://github.com/apache/spark/pull/14610.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 #14610
    
----
commit c4093f53ea128e9ef10157857a68baea2714ecc8
Author: Xin Ren <iamsh...@126.com>
Date:   2016-08-11T21:42:42Z

    [SPARK-17026] remove identical values substraction

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to