Skip to content

Instantly share code, notes, and snippets.

@youssefHosni
Created September 2, 2023 00:20
Show Gist options
  • Save youssefHosni/339d4df153ec1cbf0e1677928f8cf415 to your computer and use it in GitHub Desktop.
Save youssefHosni/339d4df153ec1cbf0e1677928f8cf415 to your computer and use it in GitHub Desktop.
import lightgbm as lgb
lgb_train = lgb.Dataset(X_train, y_train)
lgb_eval = lgb.Dataset(X_test, y_test, reference=lgb_train)
params = {'boosting_type': 'gbdt',
'objective': 'binary',
'num_leaves': 40,
'learning_rate': 0.1,
'feature_fraction': 0.9
}
gbm = lgb.train(params,
lgb_train,
num_boost_round=200,
valid_sets=[lgb_train, lgb_eval],
valid_names=['train','valid'],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment