{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/38248302","id":38248302,"diff_hunk":"@@ -817,6 +822,64 @@ class StringIndexerModel(JavaModel):\n     \"\"\"\n     Model fitted by StringIndexer.\n     \"\"\"\n+    @property\n+    def labels(self):\n+        return self._java_obj.labels\n+\n+\n+@inherit_doc\n+class IndexToString(JavaTransformer, HasInputCol, HasOutputCol):\n+    \"\"\"\n+    .. note:: Experimental\n+    A [[Transformer]] that maps a column of string indices back to a new column of corresponding\n+    string values using either the ML attributes of the input column, or if provided using the\n+    labels supplied by the user.\n+    All original columns are kept during transformation.\n+    See L{StringIndexer} for converting strings into indices\n+    \"\"\"\n+\n+    # a placeholder to make the labels show up in generated doc\n+    labels = Param(Params._dummy(), \"labels\",\n+                   \"Optional labels to be provided by the user, if not supplied column \" +\n+                   \"metadata is read for labels. The default value is an empty array, \" +\n+                   \"but the empty array is ignored and column metadata used instead.\")\n+\n+    @keyword_only\n+    def __init__(self, inputCol=None, outputCol=None, labels=[]):\n+        \"\"\"\n+        __init__(self, inputCol=None, outputCol=None, labels=[])\n+        \"\"\"\n+        super(IndexToString, self).__init__()\n+        self._java_obj = self._new_java_obj(\"org.apache.spark.ml.feature.IndexToString\",\n+                                            self.uid)\n+        self.labels = Param(self, \"labels\",\n+                            \"Optional labels to be provided by the user, if not supplied column \" +\n+                            \"metadata is read for labels. The default value is an empty array, \" +\n+                            \"but the empty array is ignored and column metadata used instead.\")\n+        kwargs = self.__init__._input_kwargs\n+        self.setParams(**kwargs)\n+\n+    @keyword_only\n+    def setParams(self, inputCol=None, outputCol=None, labels=[]):","path":"python/pyspark/ml/feature.py","position":69,"original_position":69,"commit_id":"c400e169e6b4b75372cef71aadd75cbb464e0b7f","original_commit_id":"c400e169e6b4b75372cef71aadd75cbb464e0b7f","user":{"login":"holdenk","id":59893,"avatar_url":"https://avatars.githubusercontent.com/u/59893?v=3","gravatar_id":"","url":"https://api.github.com/users/holdenk","html_url":"https://github.com/holdenk","followers_url":"https://api.github.com/users/holdenk/followers","following_url":"https://api.github.com/users/holdenk/following{/other_user}","gists_url":"https://api.github.com/users/holdenk/gists{/gist_id}","starred_url":"https://api.github.com/users/holdenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holdenk/subscriptions","organizations_url":"https://api.github.com/users/holdenk/orgs","repos_url":"https://api.github.com/users/holdenk/repos","events_url":"https://api.github.com/users/holdenk/events{/privacy}","received_events_url":"https://api.github.com/users/holdenk/received_events","type":"User","site_admin":false},"body":"My concern is the underlying Scala code uses an empty array as the default.","created_at":"2015-08-28T21:54:27Z","updated_at":"2015-08-28T21:54:27Z","html_url":"https://github.com/apache/spark/pull/7976#discussion_r38248302","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/7976","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/38248302"},"html":{"href":"https://github.com/apache/spark/pull/7976#discussion_r38248302"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/7976"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/7976","id":41737013,"html_url":"https://github.com/apache/spark/pull/7976","diff_url":"https://github.com/apache/spark/pull/7976.diff","patch_url":"https://github.com/apache/spark/pull/7976.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/7976","number":7976,"state":"open","locked":false,"title":"[SPARK-9654][ML][PYSPARK] Add IndexToString to PySpark","user":{"login":"holdenk","id":59893,"avatar_url":"https://avatars.githubusercontent.com/u/59893?v=3","gravatar_id":"","url":"https://api.github.com/users/holdenk","html_url":"https://github.com/holdenk","followers_url":"https://api.github.com/users/holdenk/followers","following_url":"https://api.github.com/users/holdenk/following{/other_user}","gists_url":"https://api.github.com/users/holdenk/gists{/gist_id}","starred_url":"https://api.github.com/users/holdenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holdenk/subscriptions","organizations_url":"https://api.github.com/users/holdenk/orgs","repos_url":"https://api.github.com/users/holdenk/repos","events_url":"https://api.github.com/users/holdenk/events{/privacy}","received_events_url":"https://api.github.com/users/holdenk/received_events","type":"User","site_admin":false},"body":"Adds IndexToString to PySpark.","created_at":"2015-08-05T23:15:04Z","updated_at":"2015-08-28T21:54:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"485b184092756b8b6079b4b74f5bd72fc4678f07","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/7976/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/7976/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/7976/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/c400e169e6b4b75372cef71aadd75cbb464e0b7f","head":{"label":"holdenk:SPARK-9654-add-string-indexer-inverse-in-pyspark","ref":"SPARK-9654-add-string-indexer-inverse-in-pyspark","sha":"c400e169e6b4b75372cef71aadd75cbb464e0b7f","user":{"login":"holdenk","id":59893,"avatar_url":"https://avatars.githubusercontent.com/u/59893?v=3","gravatar_id":"","url":"https://api.github.com/users/holdenk","html_url":"https://github.com/holdenk","followers_url":"https://api.github.com/users/holdenk/followers","following_url":"https://api.github.com/users/holdenk/following{/other_user}","gists_url":"https://api.github.com/users/holdenk/gists{/gist_id}","starred_url":"https://api.github.com/users/holdenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holdenk/subscriptions","organizations_url":"https://api.github.com/users/holdenk/orgs","repos_url":"https://api.github.com/users/holdenk/repos","events_url":"https://api.github.com/users/holdenk/events{/privacy}","received_events_url":"https://api.github.com/users/holdenk/received_events","type":"User","site_admin":false},"repo":{"id":17235154,"name":"spark","full_name":"holdenk/spark","owner":{"login":"holdenk","id":59893,"avatar_url":"https://avatars.githubusercontent.com/u/59893?v=3","gravatar_id":"","url":"https://api.github.com/users/holdenk","html_url":"https://github.com/holdenk","followers_url":"https://api.github.com/users/holdenk/followers","following_url":"https://api.github.com/users/holdenk/following{/other_user}","gists_url":"https://api.github.com/users/holdenk/gists{/gist_id}","starred_url":"https://api.github.com/users/holdenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holdenk/subscriptions","organizations_url":"https://api.github.com/users/holdenk/orgs","repos_url":"https://api.github.com/users/holdenk/repos","events_url":"https://api.github.com/users/holdenk/events{/privacy}","received_events_url":"https://api.github.com/users/holdenk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/holdenk/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/holdenk/spark","forks_url":"https://api.github.com/repos/holdenk/spark/forks","keys_url":"https://api.github.com/repos/holdenk/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/holdenk/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/holdenk/spark/teams","hooks_url":"https://api.github.com/repos/holdenk/spark/hooks","issue_events_url":"https://api.github.com/repos/holdenk/spark/issues/events{/number}","events_url":"https://api.github.com/repos/holdenk/spark/events","assignees_url":"https://api.github.com/repos/holdenk/spark/assignees{/user}","branches_url":"https://api.github.com/repos/holdenk/spark/branches{/branch}","tags_url":"https://api.github.com/repos/holdenk/spark/tags","blobs_url":"https://api.github.com/repos/holdenk/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/holdenk/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/holdenk/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/holdenk/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/holdenk/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/holdenk/spark/languages","stargazers_url":"https://api.github.com/repos/holdenk/spark/stargazers","contributors_url":"https://api.github.com/repos/holdenk/spark/contributors","subscribers_url":"https://api.github.com/repos/holdenk/spark/subscribers","subscription_url":"https://api.github.com/repos/holdenk/spark/subscription","commits_url":"https://api.github.com/repos/holdenk/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/holdenk/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/holdenk/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/holdenk/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/holdenk/spark/contents/{+path}","compare_url":"https://api.github.com/repos/holdenk/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/holdenk/spark/merges","archive_url":"https://api.github.com/repos/holdenk/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/holdenk/spark/downloads","issues_url":"https://api.github.com/repos/holdenk/spark/issues{/number}","pulls_url":"https://api.github.com/repos/holdenk/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/holdenk/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/holdenk/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/holdenk/spark/labels{/name}","releases_url":"https://api.github.com/repos/holdenk/spark/releases{/id}","created_at":"2014-02-27T03:28:28Z","updated_at":"2015-05-05T13:19:34Z","pushed_at":"2015-08-28T21:46:12Z","git_url":"git://github.com/holdenk/spark.git","ssh_url":"git@github.com:holdenk/spark.git","clone_url":"https://github.com/holdenk/spark.git","svn_url":"https://github.com/holdenk/spark","homepage":null,"size":115101,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"9b731fad2b43ca18f3c5274062d4c7bc2622ab72","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-28T18:20:32Z","pushed_at":"2015-08-28T21:49:37Z","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":1690861,"stargazers_count":5235,"watchers_count":5235,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4803,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":366,"forks":4803,"open_issues":366,"watchers":5235,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/7976"},"html":{"href":"https://github.com/apache/spark/pull/7976"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/7976"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/7976/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/7976/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/7976/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/c400e169e6b4b75372cef71aadd75cbb464e0b7f"}}}}