From 46a0ddc7d01402e4607471605e416e572822927a Mon Sep 17 00:00:00 2001 From: RektPunk Date: Sun, 15 Dec 2024 14:13:42 +0900 Subject: [PATCH] add regression example --- tests/python_package_test/test_engine.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/python_package_test/test_engine.py b/tests/python_package_test/test_engine.py index 1c8945b8067d..5f59eb3ddcd0 100644 --- a/tests/python_package_test/test_engine.py +++ b/tests/python_package_test/test_engine.py @@ -2315,6 +2315,13 @@ def test_refit_with_one_tree(): model_refit = model.refit(X, y) assert isinstance(model_refit, lgb.Booster) + X, y = make_regression(n_samples=10_000, n_features=10) + lgb_train = lgb.Dataset(X, label=y) + params = {"objective": "regression", "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_pred_leaf_output_shape(): X, y = make_regression(n_samples=10_000, n_features=10)