[examples] updated tree index with categorical feature (#2044)

* updated gitignore

* updated tree index with cat feature
This commit is contained in:
Nikita Titov 2019-03-14 05:51:48 +03:00 коммит произвёл Guolin Ke
Родитель 8d6666e0ff
Коммит 7ab94e6bba
2 изменённых файлов: 8 добавлений и 4 удалений

4
.gitignore поставляемый
Просмотреть файл

@ -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)