Skip to content

Commit

Permalink
revert the original test
Browse files Browse the repository at this point in the history
  • Loading branch information
thatlittleboy committed Jul 15, 2023
1 parent 28b5f5f commit ae6e37e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/python_package_test/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3623,15 +3623,13 @@ def test_dump_model_stump():

def test_dump_model():
X, y = load_breast_cancer(return_X_y=True)

train_data = lgb.Dataset(X, label=y)
params = {
"objective": "binary",
"verbose": -1,
}
bst = lgb.train(params, train_data, num_boost_round=5)
dumped_model = bst.dump_model(5, 0)
dumped_model_str = str(dumped_model)
dumped_model_str = str(bst.dump_model(5, 0))
assert "leaf_features" not in dumped_model_str
assert "leaf_coeff" not in dumped_model_str
assert "leaf_const" not in dumped_model_str
Expand All @@ -3641,8 +3639,7 @@ def test_dump_model():
params['linear_tree'] = True
train_data = lgb.Dataset(X, label=y)
bst = lgb.train(params, train_data, num_boost_round=5)
dumped_model = bst.dump_model(5, 0)
dumped_model_str = str(dumped_model)
dumped_model_str = str(bst.dump_model(5, 0))
assert "leaf_features" in dumped_model_str
assert "leaf_coeff" in dumped_model_str
assert "leaf_const" in dumped_model_str
Expand Down

0 comments on commit ae6e37e

Please sign in to comment.