зеркало из https://github.com/microsoft/LightGBM.git
[examples] updated tree index with categorical feature (#2044)
* updated gitignore * updated tree index with cat feature
This commit is contained in:
Родитель
8d6666e0ff
Коммит
7ab94e6bba
|
@ -393,3 +393,7 @@ lightgbm.Rcheck/
|
|||
|
||||
# Files generated by aspell
|
||||
**/*.bak
|
||||
|
||||
# GraphViz artifacts
|
||||
*.gv
|
||||
*.gv.*
|
||||
|
|
|
@ -50,10 +50,10 @@ print('Plotting feature importances...')
|
|||
ax = lgb.plot_importance(gbm, max_num_features=10)
|
||||
plt.show()
|
||||
|
||||
print('Plotting 84th tree...') # one tree use categorical feature to split
|
||||
ax = lgb.plot_tree(gbm, tree_index=83, figsize=(20, 8), show_info=['split_gain'])
|
||||
print('Plotting 54th tree...') # one tree use categorical feature to split
|
||||
ax = lgb.plot_tree(gbm, tree_index=53, figsize=(15, 15), show_info=['split_gain'])
|
||||
plt.show()
|
||||
|
||||
print('Plotting 84th tree with graphviz...')
|
||||
graph = lgb.create_tree_digraph(gbm, tree_index=83, name='Tree84')
|
||||
print('Plotting 54th tree with graphviz...')
|
||||
graph = lgb.create_tree_digraph(gbm, tree_index=53, name='Tree54')
|
||||
graph.render(view=True)
|
||||
|
|
Загрузка…
Ссылка в новой задаче