Skip to content

Commit

Permalink
fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed Mar 24, 2017
1 parent 99c6b53 commit b38a19a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/python_package_test/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class template(object):
def test_template(params={'objective': 'regression', 'metric': 'l2'},
X_y=load_boston(True), feval=mean_squared_error,
num_round=200, init_model=None, custom_eval=None,
early_stopping_rounds=10,
early_stopping_rounds=5,
return_data=False, return_model=False):
params['verbose'], params['seed'] = -1, 42
X_train, X_test, y_train, y_test = train_test_split(*X_y, test_size=0.1, random_state=42)
Expand Down Expand Up @@ -97,7 +97,7 @@ def test_continue_train_and_other(self):
evals_result, ret = template.test_template(params, feval=mean_absolute_error,
num_round=80, init_model=model_name,
custom_eval=(lambda p, d: ('mae', mean_absolute_error(p, d.get_label()), False)))
self.assertLess(ret, 3)
self.assertLess(ret, 3.5)
self.assertAlmostEqual(min(evals_result['eval']['l1']), ret, places=5)
for l1, mae in zip(evals_result['eval']['l1'], evals_result['eval']['mae']):
self.assertAlmostEqual(l1, mae, places=5)
Expand Down

0 comments on commit b38a19a

Please sign in to comment.