Skip to content

Commit

Permalink
add refit with one tree test
Browse files Browse the repository at this point in the history
  • Loading branch information
RektPunk committed Dec 14, 2024
1 parent 4c627cb commit 52c6a31
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/python_package_test/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2307,6 +2307,15 @@ def test_refit():
assert err_pred > new_err_pred


def test_refit_with_one_tree():
X, y = load_breast_cancer(return_X_y=True)
lgb_train = lgb.Dataset(X, label=y)
params={"objective": "binary", "num_trees": 1, "verbosity": -1}
model = lgb.train(params, lgb_train, num_boost_round=1)
model_refit = model.refit(X, y)
assert isinstance(model_refit, lgb.Booster)


def test_refit_dataset_params(rng):
# check refit accepts dataset_params
X, y = load_breast_cancer(return_X_y=True)
Expand Down

0 comments on commit 52c6a31

Please sign in to comment.