{"action":"created","comment":{"url":"https://api.github.com/repos/dmlc/xgboost/pulls/comments/63295702","id":63295702,"diff_hunk":"@@ -709,19 +709,37 @@ def attr(self, key):\n         else:\n             return None\n \n+    def attr_names(self):\n+        \"\"\"Get the names of attributes stored in the Booster.\n+\n+        Returns\n+        -------\n+        value : list of strings\n+            Returns an empty list if there's no attributes.\n+        \"\"\"\n+        length = ctypes.c_ulong()\n+        sarr = ctypes.POINTER(ctypes.c_char_p)()\n+        _check_call(_LIB.XGBoosterGetAttrNames(self.handle,\n+                                               ctypes.byref(length),\n+                                               ctypes.byref(sarr)))\n+        res = from_cstr_to_pystr(sarr, length)\n+        return res","path":"python-package/xgboost/core.py","position":18,"original_position":18,"commit_id":"26b36714ea2e99dbc1893afd59c1ab5f4a7aaefa","original_commit_id":"26b36714ea2e99dbc1893afd59c1ab5f4a7aaefa","user":{"login":"tqchen","id":2577440,"avatar_url":"https://avatars.githubusercontent.com/u/2577440?v=3","gravatar_id":"","url":"https://api.github.com/users/tqchen","html_url":"https://github.com/tqchen","followers_url":"https://api.github.com/users/tqchen/followers","following_url":"https://api.github.com/users/tqchen/following{/other_user}","gists_url":"https://api.github.com/users/tqchen/gists{/gist_id}","starred_url":"https://api.github.com/users/tqchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tqchen/subscriptions","organizations_url":"https://api.github.com/users/tqchen/orgs","repos_url":"https://api.github.com/users/tqchen/repos","events_url":"https://api.github.com/users/tqchen/events{/privacy}","received_events_url":"https://api.github.com/users/tqchen/received_events","type":"User","site_admin":false},"body":"no problem, I mistunderstand the function from_cstr_to_pystr","created_at":"2016-05-15T18:11:24Z","updated_at":"2016-05-15T18:11:24Z","html_url":"https://github.com/dmlc/xgboost/pull/1198#discussion_r63295702","pull_request_url":"https://api.github.com/repos/dmlc/xgboost/pulls/1198","_links":{"self":{"href":"https://api.github.com/repos/dmlc/xgboost/pulls/comments/63295702"},"html":{"href":"https://github.com/dmlc/xgboost/pull/1198#discussion_r63295702"},"pull_request":{"href":"https://api.github.com/repos/dmlc/xgboost/pulls/1198"}}},"pull_request":{"url":"https://api.github.com/repos/dmlc/xgboost/pulls/1198","id":70114329,"html_url":"https://github.com/dmlc/xgboost/pull/1198","diff_url":"https://github.com/dmlc/xgboost/pull/1198.diff","patch_url":"https://github.com/dmlc/xgboost/pull/1198.patch","issue_url":"https://api.github.com/repos/dmlc/xgboost/issues/1198","number":1198,"state":"open","locked":false,"title":"More functionality for model attributes","user":{"login":"khotilov","id":1613551,"avatar_url":"https://avatars.githubusercontent.com/u/1613551?v=3","gravatar_id":"","url":"https://api.github.com/users/khotilov","html_url":"https://github.com/khotilov","followers_url":"https://api.github.com/users/khotilov/followers","following_url":"https://api.github.com/users/khotilov/following{/other_user}","gists_url":"https://api.github.com/users/khotilov/gists{/gist_id}","starred_url":"https://api.github.com/users/khotilov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khotilov/subscriptions","organizations_url":"https://api.github.com/users/khotilov/orgs","repos_url":"https://api.github.com/users/khotilov/repos","events_url":"https://api.github.com/users/khotilov/events{/privacy}","received_events_url":"https://api.github.com/users/khotilov/received_events","type":"User","site_admin":false},"body":"- Learner and C-api: added a method to retrieve the names of available attributes\r\n- Learner and C-api: added ability to delete an attribute (C-api uses the \"setting null value means delete\" idiom; Learner gets a separate method for delete, since I didn't want to change its setter interface)\r\n- R: getters and setters for xgboost attributes\r\n- R: separate function to set xgboost parameters\r\n- R: in xgb.Booster constructor, when both modelfile and params are provided, set params *after* loading from modelfile\r\n- python: added attr_names() method; calling set_attr(a = Null) would delete an attribute\r\n\r\nLet me know if \"setting null value means delete\" is not acceptable for C or Python interface. I can add separate attr deletion methods.","created_at":"2016-05-15T07:18:09Z","updated_at":"2016-05-15T18:11:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"78a75774eb6366e6c704c2e2e88eb72469590fbe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dmlc/xgboost/pulls/1198/commits","review_comments_url":"https://api.github.com/repos/dmlc/xgboost/pulls/1198/comments","review_comment_url":"https://api.github.com/repos/dmlc/xgboost/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dmlc/xgboost/issues/1198/comments","statuses_url":"https://api.github.com/repos/dmlc/xgboost/statuses/26b36714ea2e99dbc1893afd59c1ab5f4a7aaefa","head":{"label":"khotilov:xgb_attributes","ref":"xgb_attributes","sha":"26b36714ea2e99dbc1893afd59c1ab5f4a7aaefa","user":{"login":"khotilov","id":1613551,"avatar_url":"https://avatars.githubusercontent.com/u/1613551?v=3","gravatar_id":"","url":"https://api.github.com/users/khotilov","html_url":"https://github.com/khotilov","followers_url":"https://api.github.com/users/khotilov/followers","following_url":"https://api.github.com/users/khotilov/following{/other_user}","gists_url":"https://api.github.com/users/khotilov/gists{/gist_id}","starred_url":"https://api.github.com/users/khotilov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khotilov/subscriptions","organizations_url":"https://api.github.com/users/khotilov/orgs","repos_url":"https://api.github.com/users/khotilov/repos","events_url":"https://api.github.com/users/khotilov/events{/privacy}","received_events_url":"https://api.github.com/users/khotilov/received_events","type":"User","site_admin":false},"repo":{"id":27199712,"name":"xgboost","full_name":"khotilov/xgboost","owner":{"login":"khotilov","id":1613551,"avatar_url":"https://avatars.githubusercontent.com/u/1613551?v=3","gravatar_id":"","url":"https://api.github.com/users/khotilov","html_url":"https://github.com/khotilov","followers_url":"https://api.github.com/users/khotilov/followers","following_url":"https://api.github.com/users/khotilov/following{/other_user}","gists_url":"https://api.github.com/users/khotilov/gists{/gist_id}","starred_url":"https://api.github.com/users/khotilov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khotilov/subscriptions","organizations_url":"https://api.github.com/users/khotilov/orgs","repos_url":"https://api.github.com/users/khotilov/repos","events_url":"https://api.github.com/users/khotilov/events{/privacy}","received_events_url":"https://api.github.com/users/khotilov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/khotilov/xgboost","description":"eXtreme Gradient Boosting (Tree) Library","fork":true,"url":"https://api.github.com/repos/khotilov/xgboost","forks_url":"https://api.github.com/repos/khotilov/xgboost/forks","keys_url":"https://api.github.com/repos/khotilov/xgboost/keys{/key_id}","collaborators_url":"https://api.github.com/repos/khotilov/xgboost/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/khotilov/xgboost/teams","hooks_url":"https://api.github.com/repos/khotilov/xgboost/hooks","issue_events_url":"https://api.github.com/repos/khotilov/xgboost/issues/events{/number}","events_url":"https://api.github.com/repos/khotilov/xgboost/events","assignees_url":"https://api.github.com/repos/khotilov/xgboost/assignees{/user}","branches_url":"https://api.github.com/repos/khotilov/xgboost/branches{/branch}","tags_url":"https://api.github.com/repos/khotilov/xgboost/tags","blobs_url":"https://api.github.com/repos/khotilov/xgboost/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/khotilov/xgboost/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/khotilov/xgboost/git/refs{/sha}","trees_url":"https://api.github.com/repos/khotilov/xgboost/git/trees{/sha}","statuses_url":"https://api.github.com/repos/khotilov/xgboost/statuses/{sha}","languages_url":"https://api.github.com/repos/khotilov/xgboost/languages","stargazers_url":"https://api.github.com/repos/khotilov/xgboost/stargazers","contributors_url":"https://api.github.com/repos/khotilov/xgboost/contributors","subscribers_url":"https://api.github.com/repos/khotilov/xgboost/subscribers","subscription_url":"https://api.github.com/repos/khotilov/xgboost/subscription","commits_url":"https://api.github.com/repos/khotilov/xgboost/commits{/sha}","git_commits_url":"https://api.github.com/repos/khotilov/xgboost/git/commits{/sha}","comments_url":"https://api.github.com/repos/khotilov/xgboost/comments{/number}","issue_comment_url":"https://api.github.com/repos/khotilov/xgboost/issues/comments{/number}","contents_url":"https://api.github.com/repos/khotilov/xgboost/contents/{+path}","compare_url":"https://api.github.com/repos/khotilov/xgboost/compare/{base}...{head}","merges_url":"https://api.github.com/repos/khotilov/xgboost/merges","archive_url":"https://api.github.com/repos/khotilov/xgboost/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/khotilov/xgboost/downloads","issues_url":"https://api.github.com/repos/khotilov/xgboost/issues{/number}","pulls_url":"https://api.github.com/repos/khotilov/xgboost/pulls{/number}","milestones_url":"https://api.github.com/repos/khotilov/xgboost/milestones{/number}","notifications_url":"https://api.github.com/repos/khotilov/xgboost/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/khotilov/xgboost/labels{/name}","releases_url":"https://api.github.com/repos/khotilov/xgboost/releases{/id}","deployments_url":"https://api.github.com/repos/khotilov/xgboost/deployments","created_at":"2014-11-26T22:51:30Z","updated_at":"2016-03-28T00:31:30Z","pushed_at":"2016-05-15T08:05:30Z","git_url":"git://github.com/khotilov/xgboost.git","ssh_url":"git@github.com:khotilov/xgboost.git","clone_url":"https://github.com/khotilov/xgboost.git","svn_url":"https://github.com/khotilov/xgboost","homepage":"","size":5748,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"dmlc:master","ref":"master","sha":"9c26566eb09733423f821f139938ff4105c3775d","user":{"login":"dmlc","id":11508361,"avatar_url":"https://avatars.githubusercontent.com/u/11508361?v=3","gravatar_id":"","url":"https://api.github.com/users/dmlc","html_url":"https://github.com/dmlc","followers_url":"https://api.github.com/users/dmlc/followers","following_url":"https://api.github.com/users/dmlc/following{/other_user}","gists_url":"https://api.github.com/users/dmlc/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlc/subscriptions","organizations_url":"https://api.github.com/users/dmlc/orgs","repos_url":"https://api.github.com/users/dmlc/repos","events_url":"https://api.github.com/users/dmlc/events{/privacy}","received_events_url":"https://api.github.com/users/dmlc/received_events","type":"Organization","site_admin":false},"repo":{"id":16587283,"name":"xgboost","full_name":"dmlc/xgboost","owner":{"login":"dmlc","id":11508361,"avatar_url":"https://avatars.githubusercontent.com/u/11508361?v=3","gravatar_id":"","url":"https://api.github.com/users/dmlc","html_url":"https://github.com/dmlc","followers_url":"https://api.github.com/users/dmlc/followers","following_url":"https://api.github.com/users/dmlc/following{/other_user}","gists_url":"https://api.github.com/users/dmlc/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlc/subscriptions","organizations_url":"https://api.github.com/users/dmlc/orgs","repos_url":"https://api.github.com/users/dmlc/repos","events_url":"https://api.github.com/users/dmlc/events{/privacy}","received_events_url":"https://api.github.com/users/dmlc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dmlc/xgboost","description":"Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library,  for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Flink and DataFlow","fork":false,"url":"https://api.github.com/repos/dmlc/xgboost","forks_url":"https://api.github.com/repos/dmlc/xgboost/forks","keys_url":"https://api.github.com/repos/dmlc/xgboost/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmlc/xgboost/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmlc/xgboost/teams","hooks_url":"https://api.github.com/repos/dmlc/xgboost/hooks","issue_events_url":"https://api.github.com/repos/dmlc/xgboost/issues/events{/number}","events_url":"https://api.github.com/repos/dmlc/xgboost/events","assignees_url":"https://api.github.com/repos/dmlc/xgboost/assignees{/user}","branches_url":"https://api.github.com/repos/dmlc/xgboost/branches{/branch}","tags_url":"https://api.github.com/repos/dmlc/xgboost/tags","blobs_url":"https://api.github.com/repos/dmlc/xgboost/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmlc/xgboost/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmlc/xgboost/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmlc/xgboost/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmlc/xgboost/statuses/{sha}","languages_url":"https://api.github.com/repos/dmlc/xgboost/languages","stargazers_url":"https://api.github.com/repos/dmlc/xgboost/stargazers","contributors_url":"https://api.github.com/repos/dmlc/xgboost/contributors","subscribers_url":"https://api.github.com/repos/dmlc/xgboost/subscribers","subscription_url":"https://api.github.com/repos/dmlc/xgboost/subscription","commits_url":"https://api.github.com/repos/dmlc/xgboost/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmlc/xgboost/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmlc/xgboost/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmlc/xgboost/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmlc/xgboost/contents/{+path}","compare_url":"https://api.github.com/repos/dmlc/xgboost/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmlc/xgboost/merges","archive_url":"https://api.github.com/repos/dmlc/xgboost/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmlc/xgboost/downloads","issues_url":"https://api.github.com/repos/dmlc/xgboost/issues{/number}","pulls_url":"https://api.github.com/repos/dmlc/xgboost/pulls{/number}","milestones_url":"https://api.github.com/repos/dmlc/xgboost/milestones{/number}","notifications_url":"https://api.github.com/repos/dmlc/xgboost/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmlc/xgboost/labels{/name}","releases_url":"https://api.github.com/repos/dmlc/xgboost/releases{/id}","deployments_url":"https://api.github.com/repos/dmlc/xgboost/deployments","created_at":"2014-02-06T17:28:03Z","updated_at":"2016-05-15T16:25:15Z","pushed_at":"2016-05-15T11:38:17Z","git_url":"git://github.com/dmlc/xgboost.git","ssh_url":"git@github.com:dmlc/xgboost.git","clone_url":"https://github.com/dmlc/xgboost.git","svn_url":"https://github.com/dmlc/xgboost","homepage":"","size":22255,"stargazers_count":3295,"watchers_count":3295,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1832,"mirror_url":null,"open_issues_count":170,"forks":1832,"open_issues":170,"watchers":3295,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dmlc/xgboost/pulls/1198"},"html":{"href":"https://github.com/dmlc/xgboost/pull/1198"},"issue":{"href":"https://api.github.com/repos/dmlc/xgboost/issues/1198"},"comments":{"href":"https://api.github.com/repos/dmlc/xgboost/issues/1198/comments"},"review_comments":{"href":"https://api.github.com/repos/dmlc/xgboost/pulls/1198/comments"},"review_comment":{"href":"https://api.github.com/repos/dmlc/xgboost/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dmlc/xgboost/pulls/1198/commits"},"statuses":{"href":"https://api.github.com/repos/dmlc/xgboost/statuses/26b36714ea2e99dbc1893afd59c1ab5f4a7aaefa"}}}}