Skip to content

Fix CatBoost.get_params() TypeError in test_regression#1520

Merged
jianglibigdata merged 2 commits intomainfrom
copilot/fix-catboost-get-params-error
Feb 24, 2026
Merged

Fix CatBoost.get_params() TypeError in test_regression#1520
jianglibigdata merged 2 commits intomainfrom
copilot/fix-catboost-get-params-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

Recent CatBoost versions removed the deep parameter from get_params(), causing test_regression to fail when CatBoost is selected as the best model.

The test was calling get_params("n_estimators") where the string was silently consumed as the deep positional arg on sklearn-compatible models, but CatBoost now rejects it outright.

  • Changed automl.model.estimator.get_params("n_estimators")automl.model.estimator.get_params().get("n_estimators") on lines 57 and 89, which also corrects the original intent (variable is named n_iter but was storing the full params dict)
Original prompt

This section details on the original issue you should resolve

<issue_title>CatBoost.get_params() takes 1 positional argument but 2 were given</issue_title>
<issue_description>Action failed links:
https://github.com/microsoft/FLAML/actions/runs/22291488578/job/64479481448

https://github.com/microsoft/FLAML/actions/runs/22291488578/job/64479481495

https://github.com/microsoft/FLAML/actions/runs/22291488578/job/64479481548

FAILED test/automl/test_regression.py::TestRegression::test_regression - TypeError: CatBoost.get_params() takes 1 positional argument but 2 were given</issue_description>

<agent_instructions>Fix the test errors.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…gument

CatBoost's get_params() no longer accepts positional arguments beyond self.
The test was passing "n_estimators" as a positional argument which was being
interpreted as the deep parameter. Changed to extract the n_estimators value
from the returned params dict instead.

Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix TypeError in CatBoost.get_params() method Fix CatBoost.get_params() TypeError in test_regression Feb 24, 2026
Copilot AI requested a review from thinkall February 24, 2026 03:24
@jianglibigdata jianglibigdata marked this pull request as ready for review February 24, 2026 06:59
@jianglibigdata jianglibigdata merged commit 33b6174 into main Feb 24, 2026
16 checks passed
@thinkall thinkall deleted the copilot/fix-catboost-get-params-error branch February 24, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CatBoost.get_params() takes 1 positional argument but 2 were given

3 participants