{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/comments/91237254","pull_request_review_id":11745498,"id":91237254,"diff_hunk":"@@ -108,24 +111,30 @@ def reset_learning_rate(learning_rates):\n         current number of round and the total number of boosting round \\\n         (e.g. yields learning rate decay)\n         - list l: learning_rate = l[current_round]\n-        - function f: learning_rate = f(current_round, total_boost_round)\n-\n+        - function f: learning_rate = f(current_round, total_boost_round) \\\n+                   or learning_rate = f(current_round)\n     Returns\n     -------\n     callback : function\n         The requested callback function.\n     \"\"\"\n     def callback(env):\n         \"\"\"internal function\"\"\"\n-        booster = env.model\n-        iteration = env.iteration\n         if isinstance(learning_rates, list):\n-            if len(learning_rates) != env.end_iteration:\n-                raise ValueError(\"Length of list 'learning_rates' has to equal 'num_boost_round'.\")\n-            booster.reset_parameter({'learning_rate':learning_rates[iteration]})\n+            if len(learning_rates) != env.end_iteration - env.begin_iteration:\n+                raise ValueError(\"Length of list 'learning_rates' has to equal to 'num_boost_round'.\")\n+            env.model.reset_parameter({'learning_rate':learning_rates[env.iteration]})\n         else:\n-            booster.reset_parameter({'learning_rate':learning_rates(iteration, env.end_iteration)})\n+            argc = len(inspect.getargspec(learning_rates).args)","path":"python-package/lightgbm/callback.py","position":58,"original_position":58,"commit_id":"78260c4af34146553b9499b90cc1e7df51a643e1","original_commit_id":"78260c4af34146553b9499b90cc1e7df51a643e1","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":"ok, I think we can according to this to support better fobj and feval. We can do this in another PR.","created_at":"2016-12-07T07:13:25Z","updated_at":"2016-12-07T07:13:25Z","html_url":"https://github.com/Microsoft/LightGBM/pull/114#discussion_r91237254","pull_request_url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/114","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/comments/91237254"},"html":{"href":"https://github.com/Microsoft/LightGBM/pull/114#discussion_r91237254"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/114"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/114","id":96691349,"html_url":"https://github.com/Microsoft/LightGBM/pull/114","diff_url":"https://github.com/Microsoft/LightGBM/pull/114.diff","patch_url":"https://github.com/Microsoft/LightGBM/pull/114.patch","issue_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/114","number":114,"state":"open","locked":false,"title":"re-define callback order","user":{"login":"wxchan","id":13624043,"avatar_url":"https://avatars.githubusercontent.com/u/13624043?v=3","gravatar_id":"","url":"https://api.github.com/users/wxchan","html_url":"https://github.com/wxchan","followers_url":"https://api.github.com/users/wxchan/followers","following_url":"https://api.github.com/users/wxchan/following{/other_user}","gists_url":"https://api.github.com/users/wxchan/gists{/gist_id}","starred_url":"https://api.github.com/users/wxchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wxchan/subscriptions","organizations_url":"https://api.github.com/users/wxchan/orgs","repos_url":"https://api.github.com/users/wxchan/repos","events_url":"https://api.github.com/users/wxchan/events{/privacy}","received_events_url":"https://api.github.com/users/wxchan/received_events","type":"User","site_admin":false},"body":"current problem:\r\ncallback order: user-defined in callback parameter -> reset_learning_rate/print_evaluation/record_evaluation/early_stop\r\nuser can't insert a callback between last 4 callbacks\r\n\r\nsolution:\r\nset order variable:\r\nreset_learning_rate = 10\r\nprint_evaluation = 10\r\nrecord_evaluation = 20\r\nearly_stop = 30\r\nuser-defined = some int\r\ndefault: according to index in callback parameter list, = index - len(callbacks) (all < 0)\r\n\r\ncurrent callback order:\r\nbefore iter: user-defined -> reset_learning_rate -> user-defined\r\nafter iter: user-defined -> print_evaluation -> user-defined -> record_evaluation -> user-defined -> early_stop -> user-defined","created_at":"2016-12-06T09:50:01Z","updated_at":"2016-12-07T07:13:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ebba504affb0e7f650d1ded9bcc3dad4819f17d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/114/commits","review_comments_url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/114/comments","review_comment_url":"https://api.github.com/repos/Microsoft/LightGBM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/114/comments","statuses_url":"https://api.github.com/repos/Microsoft/LightGBM/statuses/78260c4af34146553b9499b90cc1e7df51a643e1","head":{"label":"wxchan:master","ref":"master","sha":"78260c4af34146553b9499b90cc1e7df51a643e1","user":{"login":"wxchan","id":13624043,"avatar_url":"https://avatars.githubusercontent.com/u/13624043?v=3","gravatar_id":"","url":"https://api.github.com/users/wxchan","html_url":"https://github.com/wxchan","followers_url":"https://api.github.com/users/wxchan/followers","following_url":"https://api.github.com/users/wxchan/following{/other_user}","gists_url":"https://api.github.com/users/wxchan/gists{/gist_id}","starred_url":"https://api.github.com/users/wxchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wxchan/subscriptions","organizations_url":"https://api.github.com/users/wxchan/orgs","repos_url":"https://api.github.com/users/wxchan/repos","events_url":"https://api.github.com/users/wxchan/events{/privacy}","received_events_url":"https://api.github.com/users/wxchan/received_events","type":"User","site_admin":false},"repo":{"id":71334425,"name":"LightGBM","full_name":"wxchan/LightGBM","owner":{"login":"wxchan","id":13624043,"avatar_url":"https://avatars.githubusercontent.com/u/13624043?v=3","gravatar_id":"","url":"https://api.github.com/users/wxchan","html_url":"https://github.com/wxchan","followers_url":"https://api.github.com/users/wxchan/followers","following_url":"https://api.github.com/users/wxchan/following{/other_user}","gists_url":"https://api.github.com/users/wxchan/gists{/gist_id}","starred_url":"https://api.github.com/users/wxchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wxchan/subscriptions","organizations_url":"https://api.github.com/users/wxchan/orgs","repos_url":"https://api.github.com/users/wxchan/repos","events_url":"https://api.github.com/users/wxchan/events{/privacy}","received_events_url":"https://api.github.com/users/wxchan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wxchan/LightGBM","description":"LightGBM is 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":true,"url":"https://api.github.com/repos/wxchan/LightGBM","forks_url":"https://api.github.com/repos/wxchan/LightGBM/forks","keys_url":"https://api.github.com/repos/wxchan/LightGBM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wxchan/LightGBM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wxchan/LightGBM/teams","hooks_url":"https://api.github.com/repos/wxchan/LightGBM/hooks","issue_events_url":"https://api.github.com/repos/wxchan/LightGBM/issues/events{/number}","events_url":"https://api.github.com/repos/wxchan/LightGBM/events","assignees_url":"https://api.github.com/repos/wxchan/LightGBM/assignees{/user}","branches_url":"https://api.github.com/repos/wxchan/LightGBM/branches{/branch}","tags_url":"https://api.github.com/repos/wxchan/LightGBM/tags","blobs_url":"https://api.github.com/repos/wxchan/LightGBM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wxchan/LightGBM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wxchan/LightGBM/git/refs{/sha}","trees_url":"https://api.github.com/repos/wxchan/LightGBM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wxchan/LightGBM/statuses/{sha}","languages_url":"https://api.github.com/repos/wxchan/LightGBM/languages","stargazers_url":"https://api.github.com/repos/wxchan/LightGBM/stargazers","contributors_url":"https://api.github.com/repos/wxchan/LightGBM/contributors","subscribers_url":"https://api.github.com/repos/wxchan/LightGBM/subscribers","subscription_url":"https://api.github.com/repos/wxchan/LightGBM/subscription","commits_url":"https://api.github.com/repos/wxchan/LightGBM/commits{/sha}","git_commits_url":"https://api.github.com/repos/wxchan/LightGBM/git/commits{/sha}","comments_url":"https://api.github.com/repos/wxchan/LightGBM/comments{/number}","issue_comment_url":"https://api.github.com/repos/wxchan/LightGBM/issues/comments{/number}","contents_url":"https://api.github.com/repos/wxchan/LightGBM/contents/{+path}","compare_url":"https://api.github.com/repos/wxchan/LightGBM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wxchan/LightGBM/merges","archive_url":"https://api.github.com/repos/wxchan/LightGBM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wxchan/LightGBM/downloads","issues_url":"https://api.github.com/repos/wxchan/LightGBM/issues{/number}","pulls_url":"https://api.github.com/repos/wxchan/LightGBM/pulls{/number}","milestones_url":"https://api.github.com/repos/wxchan/LightGBM/milestones{/number}","notifications_url":"https://api.github.com/repos/wxchan/LightGBM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wxchan/LightGBM/labels{/name}","releases_url":"https://api.github.com/repos/wxchan/LightGBM/releases{/id}","deployments_url":"https://api.github.com/repos/wxchan/LightGBM/deployments","created_at":"2016-10-19T08:16:54Z","updated_at":"2016-10-19T08:16:56Z","pushed_at":"2016-12-07T06:24:49Z","git_url":"git://github.com/wxchan/LightGBM.git","ssh_url":"git@github.com:wxchan/LightGBM.git","clone_url":"https://github.com/wxchan/LightGBM.git","svn_url":"https://github.com/wxchan/LightGBM","homepage":"","size":2304,"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":"Microsoft:master","ref":"master","sha":"6a792d16b4a6b620653a7ef6b22ffd174886d291","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-12-07T06:59:13Z","pushed_at":"2016-12-07T07:10:02Z","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":3398,"stargazers_count":1630,"watchers_count":1630,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":262,"mirror_url":null,"open_issues_count":11,"forks":262,"open_issues":11,"watchers":1630,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/114"},"html":{"href":"https://github.com/Microsoft/LightGBM/pull/114"},"issue":{"href":"https://api.github.com/repos/Microsoft/LightGBM/issues/114"},"comments":{"href":"https://api.github.com/repos/Microsoft/LightGBM/issues/114/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/114/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/LightGBM/pulls/114/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/LightGBM/statuses/78260c4af34146553b9499b90cc1e7df51a643e1"}}}}
{"actor":{"display_login":"guolinke"}}