Commit a5f11d47 authored by Huan Zhang's avatar Huan Zhang Committed by Guolin Ke
Browse files

Use only one thread in test_basic.py (#412)

parent ab559101
...@@ -22,7 +22,8 @@ class TestBasic(unittest.TestCase): ...@@ -22,7 +22,8 @@ class TestBasic(unittest.TestCase):
"metric": "auc", "metric": "auc",
"min_data": 10, "min_data": 10,
"num_leaves": 15, "num_leaves": 15,
"verbose": -1 "verbose": -1,
"num_threads": 1
} }
bst = lgb.Booster(params, train_data) bst = lgb.Booster(params, train_data)
bst.add_valid(valid_data, "valid_1") bst.add_valid(valid_data, "valid_1")
...@@ -47,6 +48,7 @@ class TestBasic(unittest.TestCase): ...@@ -47,6 +48,7 @@ class TestBasic(unittest.TestCase):
pred_from_model_file = bst.predict(X_test) pred_from_model_file = bst.predict(X_test)
self.assertEqual(len(pred_from_matr), len(pred_from_model_file)) self.assertEqual(len(pred_from_matr), len(pred_from_model_file))
for preds in zip(pred_from_matr, pred_from_model_file): for preds in zip(pred_from_matr, pred_from_model_file):
# we need to check the consistency of model file here, so test for exact equal
self.assertEqual(*preds) self.assertEqual(*preds)
# check pmml # check pmml
os.system('python ../../pmml/pmml.py model.txt') os.system('python ../../pmml/pmml.py model.txt')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment