{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/14610","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/14610/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/14610/comments","events_url":"https://api.github.com/repos/apache/spark/issues/14610/events","html_url":"https://github.com/apache/spark/pull/14610","id":170755353,"number":14610,"title":"[SPARK-17026][MLlib][Tests] remove identical values substraction","user":{"login":"keypointt","id":3925641,"avatar_url":"https://avatars.githubusercontent.com/u/3925641?v=3","gravatar_id":"","url":"https://api.github.com/users/keypointt","html_url":"https://github.com/keypointt","followers_url":"https://api.github.com/users/keypointt/followers","following_url":"https://api.github.com/users/keypointt/following{/other_user}","gists_url":"https://api.github.com/users/keypointt/gists{/gist_id}","starred_url":"https://api.github.com/users/keypointt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keypointt/subscriptions","organizations_url":"https://api.github.com/users/keypointt/orgs","repos_url":"https://api.github.com/users/keypointt/repos","events_url":"https://api.github.com/users/keypointt/events{/privacy}","received_events_url":"https://api.github.com/users/keypointt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-11T21:47:16Z","updated_at":"2016-08-11T22:47:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/14610","html_url":"https://github.com/apache/spark/pull/14610","diff_url":"https://github.com/apache/spark/pull/14610.diff","patch_url":"https://github.com/apache/spark/pull/14610.patch"},"body":"https://issues.apache.org/jira/browse/SPARK-17026\r\n\r\n## What changes were proposed in this pull request?\r\n\r\nI'm not sure if this is a valid patch, just submitting for the record.\r\n\r\nGot warning when building project:\r\n```\r\n[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.\r\n[warn]    assert(math.abs(metrics.accuracy - metrics.precision) < delta)\r\n[warn]                                                ^\r\n[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.\r\n[warn]    assert(math.abs(metrics.accuracy - metrics.recall) < delta)\r\n[warn]                                                ^\r\n[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.\r\n[warn]    assert(math.abs(metrics.accuracy - metrics.fMeasure) < delta)\r\n[warn]                                                ^\r\n```\r\n\r\nAnd `precision` and `recall` and `fMeasure` are all referencing to `accuracy`. So in this PR I just removed these 3 assert.\r\n```\r\n    assert(math.abs(metrics.accuracy - metrics.precision) < delta)\r\n    assert(math.abs(metrics.accuracy - metrics.recall) < delta)\r\n    assert(math.abs(metrics.accuracy - metrics.fMeasure) < delta)\r\n```\r\n\r\n```\r\n  /**\r\n   * Returns precision\r\n   */\r\n  @Since(\"1.1.0\")\r\n  @deprecated(\"Use accuracy.\", \"2.0.0\")\r\n  lazy val precision: Double = accuracy\r\n\r\n\r\n  /**\r\n   * Returns recall\r\n   * (equals to precision for multiclass classifier\r\n   * because sum of all false positives is equal to sum\r\n   * of all false negatives)\r\n   */\r\n  @Since(\"1.1.0\")\r\n  @deprecated(\"Use accuracy.\", \"2.0.0\")\r\n  lazy val recall: Double = accuracy\r\n\r\n\r\n  /**\r\n   * Returns f-measure\r\n   * (equals to precision and recall because precision equals recall)\r\n   */\r\n  @Since(\"1.1.0\")\r\n  @deprecated(\"Use accuracy.\", \"2.0.0\")\r\n  lazy val fMeasure: Double = accuracy\r\n```\r\n\r\n\r\n\r\n## How was this patch tested?\r\n\r\nTested manually on local laptop\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/239316419","html_url":"https://github.com/apache/spark/pull/14610#issuecomment-239316419","issue_url":"https://api.github.com/repos/apache/spark/issues/14610","id":239316419,"user":{"login":"keypointt","id":3925641,"avatar_url":"https://avatars.githubusercontent.com/u/3925641?v=3","gravatar_id":"","url":"https://api.github.com/users/keypointt","html_url":"https://github.com/keypointt","followers_url":"https://api.github.com/users/keypointt/followers","following_url":"https://api.github.com/users/keypointt/following{/other_user}","gists_url":"https://api.github.com/users/keypointt/gists{/gist_id}","starred_url":"https://api.github.com/users/keypointt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keypointt/subscriptions","organizations_url":"https://api.github.com/users/keypointt/orgs","repos_url":"https://api.github.com/users/keypointt/repos","events_url":"https://api.github.com/users/keypointt/events{/privacy}","received_events_url":"https://api.github.com/users/keypointt/received_events","type":"User","site_admin":false},"created_at":"2016-08-11T22:47:07Z","updated_at":"2016-08-11T22:47:07Z","body":"because `metrics.accuracy`, `metrics.precision`, `metrics.recall` and `metrics.fMeasure` are exactly the same value, no point to check the difference (always 0) with delta https://github.com/apache/spark/blob/branch-2.0/mllib/src/main/scala/org/apache/spark/mllib/evaluation/MulticlassMetrics.scala#L137-L160\r\n\r\n```\r\n  lazy val precision: Double = accuracy\r\n  lazy val recall: Double = accuracy\r\n  lazy val fMeasure: Double = accuracy\r\n```"}}
{"actor":{"display_login":"keypointt"}}