(self)
| 9 | # Based on the "simple_example" from their documentation: |
| 10 | # https://github.com/Microsoft/LightGBM/blob/master/examples/python-guide/simple_example.py |
| 11 | def test_cpu(self): |
| 12 | lgb_train, lgb_eval = self.load_datasets() |
| 13 | |
| 14 | params = { |
| 15 | 'task': 'train', |
| 16 | 'boosting_type': 'gbdt', |
| 17 | 'objective': 'regression', |
| 18 | 'metric': {'l2', 'auc'}, |
| 19 | 'num_leaves': 31, |
| 20 | 'learning_rate': 0.05, |
| 21 | 'feature_fraction': 0.9, |
| 22 | 'bagging_fraction': 0.8, |
| 23 | 'bagging_freq': 5, |
| 24 | 'force_row_wise': True, |
| 25 | 'verbose': 0 |
| 26 | } |
| 27 | |
| 28 | # Run only one round for faster test |
| 29 | gbm = lgb.train(params, |
| 30 | lgb_train, |
| 31 | num_boost_round=1, |
| 32 | valid_sets=lgb_eval, |
| 33 | callbacks=[lgb.early_stopping(stopping_rounds=1)]) |
| 34 | |
| 35 | self.assertEqual(1, gbm.best_iteration) |
| 36 | |
| 37 | @gpu_test |
| 38 | def test_gpu(self): |
nothing calls this directly
no test coverage detected