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

Count number of leaves in the final ensemble #4969

Closed
samanemami opened this issue Jan 23, 2022 · 3 comments
Closed

Count number of leaves in the final ensemble #4969

samanemami opened this issue Jan 23, 2022 · 3 comments
Labels

Comments

@samanemami
Copy link

Summary

During the training, the model builds a decision tree regressor with a different number of leaves.

The question here is that each tree has how many leaves?

Motivation

To compare the lightGBM model size with different models such as XGBoost

We can check the size of the model

Description

The model already has the dump method, is there any feature to return the leaves from the dumped model?

@StrikerRUS
Copy link
Collaborator

Hey @samanemami, thanks for using LightGBM!

You can count number of leaves with the help of trees_to_dataframe() method which parses a dumped model for you.
#4944 (comment)

@samanemami
Copy link
Author

Thank you @StrikerRUS

@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 23, 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

2 participants