Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'LGBMRegressor' object has no attribute 'n_estimators_' #5337

Closed
phantng opened this issue Jun 29, 2022 · 4 comments
Closed

'LGBMRegressor' object has no attribute 'n_estimators_' #5337

phantng opened this issue Jun 29, 2022 · 4 comments
Labels

Comments

@phantng
Copy link

phantng commented Jun 29, 2022

Description

The 'LGBMRegressor' object has no attribute 'n_estimators_' but it does have 'n_estimators', which is inconsistent with the documentation in https://lightgbm.readthedocs.io/en/latest/pythonapi/lightgbm.LGBMRegressor.html.

Reproducible example

model = lgb.LGBMRegressor(**model_config)
model = model.fit(x_train, y_train)
...
print(model.n_estimators_)

Environment info

lightgbm=3.3.2
python=3.9.7

@jmoralez
Copy link
Collaborator

Hi @phantng, thanks for raising this. The docs point to the latest version, which is what is currently on master. The n_estimators_ attribute was added in #4753 so you can access it now but not on 3.3.2. On the bottom of the left sidebar of the docs page you can switch the version to 3.3.2 where you won't find n_estimators_.

@jmoralez
Copy link
Collaborator

@jameslamb @StrikerRUS can we make the default page be the latest release (3.3.2 in this case) instead of the current master on readthedocs? It can be very confusing finding things that aren't there yet and getting errors, and we've had a couple of issues because of it (#5113 comes to mind but I think we've had some more).

@jameslamb
Copy link
Collaborator

Thanks for bringing it up @jmoralez . I have been meaning to open an issue about that since #5185, your @ reminded me to do it. Created #5342 . Let's move the discussion about what to do with the docs site over there.

Based on the 👍 from @phantng on #5337 (comment), I'm going to close this issue.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants