{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/comments/89671569","pull_request_review_id":10215157,"id":89671569,"diff_hunk":"@@ -258,69 +306,83 @@ DllExport int LGBM_BoosterUpdateOneIter(BoosterHandle handle, int* is_finished);\n * \\param grad gradient statistics\n * \\param hess second order gradient statistics\n * \\param is_finished 1 means finised(cannot split any more)\n-* \\return 0 when success, -1 when failure happens\n+* \\return 0 when succeed, -1 when failure happens\n */\n DllExport int LGBM_BoosterUpdateOneIterCustom(BoosterHandle handle,\n   const float* grad,\n   const float* hess,\n   int* is_finished);\n \n /*!\n-* \\brief get evaluation for training data and validation data\n+* \\brief Rollback one iteration\n * \\param handle handle\n-* \\param data 0:training data, 1: 1st valid data, 2:2nd valid data ...\n-* \\param out_len len of output result\n-* \\param out_result the string containing evaluation statistics, should allocate memory before call this function\n-* \\return 0 when success, -1 when failure happens\n+* \\return 0 when succeed, -1 when failure happens\n */\n-DllExport int LGBM_BoosterEval(BoosterHandle handle,\n-  int data,\n-  int64_t* out_len,\n-  float* out_results);\n+DllExport int LGBM_BoosterRollbackOneIter(BoosterHandle handle);\n+\n+/*!\n+* \\brief Get iteration of current boosting rounds\n+* \\return iteration of boosting rounds\n+*/\n+DllExport int LGBM_BoosterGetCurrentIteration(BoosterHandle handle, int64_t* out_iteration);\n \n /*!\n-* \\brief get raw score for training data, used to calculate gradients outside\n+* \\brief Get number of eval \n+* \\return total number of eval result\n+*/\n+DllExport int LGBM_BoosterGetEvalCounts(BoosterHandle handle, int64_t* out_len);\n+\n+/*!\n+* \\brief Get number of eval\n+* \\return total number of eval result\n+*/\n+DllExport int LGBM_BoosterGetEvalNames(BoosterHandle handle, int64_t* out_len, char** out_strs);\n+\n+/*!\n+* \\brief get evaluation for training data and validation data\n * \\param handle handle\n+* \\param data_idx 0:training data, 1: 1st valid data, 2:2nd valid data ...\n * \\param out_len len of output result\n-* \\param out_result used to set a pointer to array\n-* \\return 0 when success, -1 when failure happens\n+* \\param out_result the string containing evaluation statistics, should allocate memory before call this function\n+* \\return 0 when succeed, -1 when failure happens\n */\n-DllExport int LGBM_BoosterGetScore(BoosterHandle handle,\n+DllExport int LGBM_BoosterGetEval(BoosterHandle handle,\n+  int data_idx,\n   int64_t* out_len,","path":"include/LightGBM/c_api.h","position":309,"original_position":309,"commit_id":"67ca60915033e01b8f9fd664d4089b245f810fd6","original_commit_id":"67ca60915033e01b8f9fd664d4089b245f810fd6","user":{"login":"Allardvm","id":11735900,"avatar_url":"https://avatars.githubusercontent.com/u/11735900?v=3","gravatar_id":"","url":"https://api.github.com/users/Allardvm","html_url":"https://github.com/Allardvm","followers_url":"https://api.github.com/users/Allardvm/followers","following_url":"https://api.github.com/users/Allardvm/following{/other_user}","gists_url":"https://api.github.com/users/Allardvm/gists{/gist_id}","starred_url":"https://api.github.com/users/Allardvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Allardvm/subscriptions","organizations_url":"https://api.github.com/users/Allardvm/orgs","repos_url":"https://api.github.com/users/Allardvm/repos","events_url":"https://api.github.com/users/Allardvm/events{/privacy}","received_events_url":"https://api.github.com/users/Allardvm/received_events","type":"User","site_admin":false},"body":"I guess the parameter `out_len` is not really required anymore for this function, nor for any of the other functions that have an `out_results` parameter that needs to be allocated by the caller. As far as I can see, every function that has this signature, have an accompanying function that can be called to get the exact length of the array that should be allocated (e.g. `LGBM_BoosterGetEvalCounts()` here). So it would be rather wasteful to rely on `out_len` to shrink an over-allocated array after the call. Or are there any other cases in which this parameter would be useful?","created_at":"2016-11-26T13:20:48Z","updated_at":"2016-11-26T13:20:48Z","html_url":"https://github.com/Microsoft/LightGBM/pull/94#discussion_r89671569","pull_request_url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/comments/89671569"},"html":{"href":"https://github.com/Microsoft/LightGBM/pull/94#discussion_r89671569"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/94","id":95141220,"html_url":"https://github.com/Microsoft/LightGBM/pull/94","diff_url":"https://github.com/Microsoft/LightGBM/pull/94.diff","patch_url":"https://github.com/Microsoft/LightGBM/pull/94.patch","issue_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/94","number":94,"state":"open","locked":false,"title":"Python package (#11)","user":{"login":"guolinke","id":16040950,"avatar_url":"https://avatars.githubusercontent.com/u/16040950?v=3","gravatar_id":"","url":"https://api.github.com/users/guolinke","html_url":"https://github.com/guolinke","followers_url":"https://api.github.com/users/guolinke/followers","following_url":"https://api.github.com/users/guolinke/following{/other_user}","gists_url":"https://api.github.com/users/guolinke/gists{/gist_id}","starred_url":"https://api.github.com/users/guolinke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guolinke/subscriptions","organizations_url":"https://api.github.com/users/guolinke/orgs","repos_url":"https://api.github.com/users/guolinke/repos","events_url":"https://api.github.com/users/guolinke/events{/privacy}","received_events_url":"https://api.github.com/users/guolinke/received_events","type":"User","site_admin":false},"body":"refer to #11 \r\n\r\nI finish the basic wrapper class for c_api . \r\nNow will start some tests and collect some feedback.","created_at":"2016-11-24T09:17:29Z","updated_at":"2016-11-26T13:20:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19d55b913cc9d4e540f2d277be31804e27bfefc2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/94/commits","review_comments_url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/94/comments","review_comment_url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/94/comments","statuses_url":"https://api.github.com/repos/Microsoft/LightGBM/statuses/67ca60915033e01b8f9fd664d4089b245f810fd6","head":{"label":"Microsoft:python-package","ref":"python-package","sha":"67ca60915033e01b8f9fd664d4089b245f810fd6","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":64991887,"name":"LightGBM","full_name":"Microsoft/LightGBM","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/LightGBM","description":"A fast, distributed, high performance gradient boosting (GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks. It is under the umbrella of the DMTK(http://github.com/microsoft/dmtk) project of Microsoft.","fork":false,"url":"https://api.github.com/repos/Microsoft/LightGBM","forks_url":"https://api.github.com/repos/Microsoft/LightGBM/forks","keys_url":"https://api.github.com/repos/Microsoft/LightGBM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/LightGBM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/LightGBM/teams","hooks_url":"https://api.github.com/repos/Microsoft/LightGBM/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/LightGBM/events","assignees_url":"https://api.github.com/repos/Microsoft/LightGBM/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/LightGBM/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/LightGBM/tags","blobs_url":"https://api.github.com/repos/Microsoft/LightGBM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/LightGBM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/LightGBM/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/LightGBM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/LightGBM/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/LightGBM/languages","stargazers_url":"https://api.github.com/repos/Microsoft/LightGBM/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/LightGBM/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/LightGBM/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/LightGBM/subscription","commits_url":"https://api.github.com/repos/Microsoft/LightGBM/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/LightGBM/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/LightGBM/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/LightGBM/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/LightGBM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/LightGBM/merges","archive_url":"https://api.github.com/repos/Microsoft/LightGBM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/LightGBM/downloads","issues_url":"https://api.github.com/repos/Microsoft/LightGBM/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/LightGBM/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/LightGBM/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/LightGBM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/LightGBM/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/LightGBM/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/LightGBM/deployments","created_at":"2016-08-05T05:45:50Z","updated_at":"2016-11-26T08:57:06Z","pushed_at":"2016-11-26T07:24:43Z","git_url":"git://github.com/Microsoft/LightGBM.git","ssh_url":"git@github.com:Microsoft/LightGBM.git","clone_url":"https://github.com/Microsoft/LightGBM.git","svn_url":"https://github.com/Microsoft/LightGBM","homepage":"","size":3213,"stargazers_count":1590,"watchers_count":1590,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":251,"mirror_url":null,"open_issues_count":11,"forks":251,"open_issues":11,"watchers":1590,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"65e711a285b212d4bfbdf3b0a3d1921b41df0f6e","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":64991887,"name":"LightGBM","full_name":"Microsoft/LightGBM","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/LightGBM","description":"A fast, distributed, high performance gradient boosting (GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks. It is under the umbrella of the DMTK(http://github.com/microsoft/dmtk) project of Microsoft.","fork":false,"url":"https://api.github.com/repos/Microsoft/LightGBM","forks_url":"https://api.github.com/repos/Microsoft/LightGBM/forks","keys_url":"https://api.github.com/repos/Microsoft/LightGBM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/LightGBM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/LightGBM/teams","hooks_url":"https://api.github.com/repos/Microsoft/LightGBM/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/LightGBM/events","assignees_url":"https://api.github.com/repos/Microsoft/LightGBM/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/LightGBM/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/LightGBM/tags","blobs_url":"https://api.github.com/repos/Microsoft/LightGBM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/LightGBM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/LightGBM/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/LightGBM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/LightGBM/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/LightGBM/languages","stargazers_url":"https://api.github.com/repos/Microsoft/LightGBM/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/LightGBM/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/LightGBM/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/LightGBM/subscription","commits_url":"https://api.github.com/repos/Microsoft/LightGBM/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/LightGBM/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/LightGBM/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/LightGBM/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/LightGBM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/LightGBM/merges","archive_url":"https://api.github.com/repos/Microsoft/LightGBM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/LightGBM/downloads","issues_url":"https://api.github.com/repos/Microsoft/LightGBM/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/LightGBM/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/LightGBM/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/LightGBM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/LightGBM/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/LightGBM/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/LightGBM/deployments","created_at":"2016-08-05T05:45:50Z","updated_at":"2016-11-26T08:57:06Z","pushed_at":"2016-11-26T07:24:43Z","git_url":"git://github.com/Microsoft/LightGBM.git","ssh_url":"git@github.com:Microsoft/LightGBM.git","clone_url":"https://github.com/Microsoft/LightGBM.git","svn_url":"https://github.com/Microsoft/LightGBM","homepage":"","size":3213,"stargazers_count":1590,"watchers_count":1590,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":251,"mirror_url":null,"open_issues_count":11,"forks":251,"open_issues":11,"watchers":1590,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/94"},"html":{"href":"https://github.com/Microsoft/LightGBM/pull/94"},"issue":{"href":"https://api.github.com/repos/Microsoft/LightGBM/issues/94"},"comments":{"href":"https://api.github.com/repos/Microsoft/LightGBM/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/LightGBM/statuses/67ca60915033e01b8f9fd664d4089b245f810fd6"}}}}
{"actor":{"display_login":"Allardvm"}}