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

Add support for linear trees and num_cat > 0 #18

Open
pavelzw opened this issue Mar 10, 2023 · 1 comment
Open

Add support for linear trees and num_cat > 0 #18

pavelzw opened this issue Mar 10, 2023 · 1 comment

Comments

@pavelzw
Copy link
Member

pavelzw commented Mar 10, 2023

In gbdt_model_text.cpp GBDT::LoadModelFromString we can see how a model string should look like in LGBM.
When looking into tree.cpp Tree::Tree, we can see that there are linear trees as well as trees with num_cat > 0.

The current implementation doesn't support these options yet.

For testing purposes, we can generate linear trees using

regressor = lgb.LGBMRegressor(n_estimators=100, random_state=42, linear_trees=True)
regressor.fit(*generate_dataset(n_samples=10000))
@YYYasin19
Copy link
Contributor

Just as reference: (feature name, number of values)

('num_leaves', 1)
('num_cat', 1)
('split_feature', 30)
('split_gain', 30)
('threshold', 30)
('decision_type', 30)
('left_child', 30)
('right_child', 30)
('leaf_value', 31)
('leaf_weight', 31)
('leaf_count', 31)
('internal_value', 30)
('internal_weight', 30)
('internal_count', 30)
('is_linear', 1)
('leaf_const', 31)
('num_features', 31)
('leaf_features', 217)
('leaf_coeff', 217)
('shrinkage', 1)

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

No branches or pull requests

2 participants