{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/38047496","id":38047496,"diff_hunk":"@@ -85,6 +88,9 @@ def _evaluate(self, dataset):\n         self._transfer_params_to_java()\n         return self._java_obj.evaluate(dataset._jdf)\n \n+    def isLargerBetter(self):\n+        return self._java_obj.isLargerBetter()","path":"python/pyspark/ml/evaluation.py","position":15,"original_position":15,"commit_id":"7794cf73e10f2b5c57cfff1a2ea4a175e282c33c","original_commit_id":"7794cf73e10f2b5c57cfff1a2ea4a175e282c33c","user":{"login":"jkbradley","id":5084283,"avatar_url":"https://avatars.githubusercontent.com/u/5084283?v=3","gravatar_id":"","url":"https://api.github.com/users/jkbradley","html_url":"https://github.com/jkbradley","followers_url":"https://api.github.com/users/jkbradley/followers","following_url":"https://api.github.com/users/jkbradley/following{/other_user}","gists_url":"https://api.github.com/users/jkbradley/gists{/gist_id}","starred_url":"https://api.github.com/users/jkbradley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkbradley/subscriptions","organizations_url":"https://api.github.com/users/jkbradley/orgs","repos_url":"https://api.github.com/users/jkbradley/repos","events_url":"https://api.github.com/users/jkbradley/events{/privacy}","received_events_url":"https://api.github.com/users/jkbradley/received_events","type":"User","site_admin":false},"body":"This works for current use since it's called after evaluate has been called, but it could fail if a user calls it since the params may not have been transferred to java yet.  Call ```self._transfer_params_to_java()``` first.","created_at":"2015-08-26T23:23:43Z","updated_at":"2015-08-26T23:23:43Z","html_url":"https://github.com/apache/spark/pull/8399#discussion_r38047496","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/8399","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/38047496"},"html":{"href":"https://github.com/apache/spark/pull/8399#discussion_r38047496"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/8399"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/8399","id":43209833,"html_url":"https://github.com/apache/spark/pull/8399","diff_url":"https://github.com/apache/spark/pull/8399.diff","patch_url":"https://github.com/apache/spark/pull/8399.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/8399","number":8399,"state":"open","locked":false,"title":"[SPARK-10188] [Pyspark] Pyspark CrossValidator with RMSE selects incorrect model","user":{"login":"noel-smith","id":11915197,"avatar_url":"https://avatars.githubusercontent.com/u/11915197?v=3","gravatar_id":"","url":"https://api.github.com/users/noel-smith","html_url":"https://github.com/noel-smith","followers_url":"https://api.github.com/users/noel-smith/followers","following_url":"https://api.github.com/users/noel-smith/following{/other_user}","gists_url":"https://api.github.com/users/noel-smith/gists{/gist_id}","starred_url":"https://api.github.com/users/noel-smith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noel-smith/subscriptions","organizations_url":"https://api.github.com/users/noel-smith/orgs","repos_url":"https://api.github.com/users/noel-smith/repos","events_url":"https://api.github.com/users/noel-smith/events{/privacy}","received_events_url":"https://api.github.com/users/noel-smith/received_events","type":"User","site_admin":false},"body":"* Added isLargerBetter() method to Pyspark Evaluator to match the Scala version.\r\n* JavaEvaluator delegates isLargerBetter() to underlying Scala object.\r\n* Added check for isLargerBetter() in CrossValidator to determine whether to use argmin or argmax.\r\n* Added test cases for where smaller is better (RMSE) and larger is better (R-Squared).\r\n\r\n(This contribution is my original work and that I license the work to the project under Sparks' open source license)","created_at":"2015-08-24T19:07:18Z","updated_at":"2015-08-26T23:23:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff1e4c6a497fe21940f898a1e2acee4dff9e753c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/8399/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/8399/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/8399/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/7794cf73e10f2b5c57cfff1a2ea4a175e282c33c","head":{"label":"noel-smith:pyspark-rmse-xval-fix","ref":"pyspark-rmse-xval-fix","sha":"7794cf73e10f2b5c57cfff1a2ea4a175e282c33c","user":{"login":"noel-smith","id":11915197,"avatar_url":"https://avatars.githubusercontent.com/u/11915197?v=3","gravatar_id":"","url":"https://api.github.com/users/noel-smith","html_url":"https://github.com/noel-smith","followers_url":"https://api.github.com/users/noel-smith/followers","following_url":"https://api.github.com/users/noel-smith/following{/other_user}","gists_url":"https://api.github.com/users/noel-smith/gists{/gist_id}","starred_url":"https://api.github.com/users/noel-smith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noel-smith/subscriptions","organizations_url":"https://api.github.com/users/noel-smith/orgs","repos_url":"https://api.github.com/users/noel-smith/repos","events_url":"https://api.github.com/users/noel-smith/events{/privacy}","received_events_url":"https://api.github.com/users/noel-smith/received_events","type":"User","site_admin":false},"repo":{"id":41261848,"name":"spark","full_name":"noel-smith/spark","owner":{"login":"noel-smith","id":11915197,"avatar_url":"https://avatars.githubusercontent.com/u/11915197?v=3","gravatar_id":"","url":"https://api.github.com/users/noel-smith","html_url":"https://github.com/noel-smith","followers_url":"https://api.github.com/users/noel-smith/followers","following_url":"https://api.github.com/users/noel-smith/following{/other_user}","gists_url":"https://api.github.com/users/noel-smith/gists{/gist_id}","starred_url":"https://api.github.com/users/noel-smith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noel-smith/subscriptions","organizations_url":"https://api.github.com/users/noel-smith/orgs","repos_url":"https://api.github.com/users/noel-smith/repos","events_url":"https://api.github.com/users/noel-smith/events{/privacy}","received_events_url":"https://api.github.com/users/noel-smith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/noel-smith/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/noel-smith/spark","forks_url":"https://api.github.com/repos/noel-smith/spark/forks","keys_url":"https://api.github.com/repos/noel-smith/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/noel-smith/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/noel-smith/spark/teams","hooks_url":"https://api.github.com/repos/noel-smith/spark/hooks","issue_events_url":"https://api.github.com/repos/noel-smith/spark/issues/events{/number}","events_url":"https://api.github.com/repos/noel-smith/spark/events","assignees_url":"https://api.github.com/repos/noel-smith/spark/assignees{/user}","branches_url":"https://api.github.com/repos/noel-smith/spark/branches{/branch}","tags_url":"https://api.github.com/repos/noel-smith/spark/tags","blobs_url":"https://api.github.com/repos/noel-smith/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/noel-smith/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/noel-smith/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/noel-smith/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/noel-smith/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/noel-smith/spark/languages","stargazers_url":"https://api.github.com/repos/noel-smith/spark/stargazers","contributors_url":"https://api.github.com/repos/noel-smith/spark/contributors","subscribers_url":"https://api.github.com/repos/noel-smith/spark/subscribers","subscription_url":"https://api.github.com/repos/noel-smith/spark/subscription","commits_url":"https://api.github.com/repos/noel-smith/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/noel-smith/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/noel-smith/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/noel-smith/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/noel-smith/spark/contents/{+path}","compare_url":"https://api.github.com/repos/noel-smith/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/noel-smith/spark/merges","archive_url":"https://api.github.com/repos/noel-smith/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/noel-smith/spark/downloads","issues_url":"https://api.github.com/repos/noel-smith/spark/issues{/number}","pulls_url":"https://api.github.com/repos/noel-smith/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/noel-smith/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/noel-smith/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/noel-smith/spark/labels{/name}","releases_url":"https://api.github.com/repos/noel-smith/spark/releases{/id}","created_at":"2015-08-23T18:31:26Z","updated_at":"2015-08-23T18:31:48Z","pushed_at":"2015-08-25T18:29:53Z","git_url":"git://github.com/noel-smith/spark.git","ssh_url":"git@github.com:noel-smith/spark.git","clone_url":"https://github.com/noel-smith/spark.git","svn_url":"https://github.com/noel-smith/spark","homepage":null,"size":123101,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"053d94fcf32268369b5a40837271f15d6af41aa4","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2015-08-26T23:15:01Z","pushed_at":"2015-08-26T23:05:10Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":1682860,"stargazers_count":5203,"watchers_count":5203,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4777,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":368,"forks":4777,"open_issues":368,"watchers":5203,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/8399"},"html":{"href":"https://github.com/apache/spark/pull/8399"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/8399"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/8399/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/8399/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/8399/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/7794cf73e10f2b5c57cfff1a2ea4a175e282c33c"}}}}