Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import lightgbm as lgbm
train_data = lgbm.Dataset(xtrain, ytrain)
test_data = lgbm.Dataset(xtest, ytest)
# define parameters
parameters = {
'objective': 'binary',
'metric': 'auc',
'is_unbalance': 'true',
'feature_fraction': 0.5,
'bagging_fraction': 0.5,
'bagging_freq': 20,
'num_threads' : 2,
'seed' : 76
}
# train lightGBM model
model = lgbm.train(parameters,
train_data,
valid_sets=test_data,
num_boost_round=1000,
early_stopping_rounds=20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.