{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/LightGBM/issues/741","repository_url":"https://api.github.com/repos/Microsoft/LightGBM","labels_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/741/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/741/comments","events_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/741/events","html_url":"https://github.com/Microsoft/LightGBM/issues/741","id":246251335,"number":741,"title":"Why the test error are so different between lightGBM and xgboost ?","user":{"login":"yananchen1989","id":26405281,"avatar_url":"https://avatars2.githubusercontent.com/u/26405281?v=4","gravatar_id":"","url":"https://api.github.com/users/yananchen1989","html_url":"https://github.com/yananchen1989","followers_url":"https://api.github.com/users/yananchen1989/followers","following_url":"https://api.github.com/users/yananchen1989/following{/other_user}","gists_url":"https://api.github.com/users/yananchen1989/gists{/gist_id}","starred_url":"https://api.github.com/users/yananchen1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yananchen1989/subscriptions","organizations_url":"https://api.github.com/users/yananchen1989/orgs","repos_url":"https://api.github.com/users/yananchen1989/repos","events_url":"https://api.github.com/users/yananchen1989/events{/privacy}","received_events_url":"https://api.github.com/users/yananchen1989/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-28T06:10:32Z","updated_at":"2017-07-28T06:56:01Z","closed_at":"2017-07-28T06:56:01Z","body":"I try to compare the model of lightgbm and xgboost to test whether the evaluation error is the same on a dataset. To my surprise, although I try to keep the parameters same, the evaluation results are so different. (lightGBM is much worse than xgboost)\r\nHere is the code for param tuning. Anything wrong that I have not noticed ? Thanks.\r\n```\r\n################lightGBM###\r\nlgb_train = lgb.Dataset(train_x, label=train_y,\\\r\n\tfeature_name=attributes[0:-1], categorical_feature=attributes[-3:-1] )\r\nlgb_eval = lgb.Dataset(test_x, label=test_y, reference=lgb_train)\r\nparams = {\r\n    'task': 'train',\r\n    'boosting_type': 'gbdt', #rf\r\n    'objective': 'binary',\r\n    'metric': {'auc'},\r\n    'num_leaves': 31,\r\n    'learning_rate': 0.05,\r\n    'max_depth':8,\r\n    'feature_fraction': 0.9,\r\n    'bagging_fraction': 0.8,\r\n    'bagging_freq': 5,\r\n    'verbose': 0,\r\n    'is_unbalance':True,\r\n    'scale_pos_weight':9.2,\r\n    'is_training_metric':True,\r\n    'lambda_l1':0,\r\n    'lambda_l2':0,\r\n}\r\nbst = lgb.train(params, lgb_train, num_boost_round=900, valid_sets=[lgb_train,lgb_eval],early_stopping_rounds=100)\r\n```\r\n\r\n```\r\n#############xgboost############\r\ndtrain = xgb.DMatrix( train_x, label=train_y) \r\ndtest = xgb.DMatrix( test_x, label=test_y) \r\nparams = {\"objective\": \"binary:logistic\", \"eta\": 0.04, \"max_depth\": 8, \"seed\": 42, \"subsample\":0.76,\r\n              \"eval_metric\":'auc', \"scale_pos_weight\":9.2}\r\nwatchlist  = [ (dtrain,'eval'), (dtrain,'train')] \r\nmodel = xgb.train(params, dtrain, num_boost_round=50, watchlist)\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/LightGBM/issues/comments/318576386","html_url":"https://github.com/Microsoft/LightGBM/issues/741#issuecomment-318576386","issue_url":"https://api.github.com/repos/Microsoft/LightGBM/issues/741","id":318576386,"user":{"login":"guolinke","id":16040950,"avatar_url":"https://avatars0.githubusercontent.com/u/16040950?v=4","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},"created_at":"2017-07-28T06:56:01Z","updated_at":"2017-07-28T06:56:01Z","body":"@yananchen1989 \r\nThe parameter of lightgbm don't match xgb.\r\ne.g. num_leaves=31 with max_depth=8 ? "}}
{"actor":{"display_login":"guolinke"}}