Commit 7ab94e6b authored by Nikita Titov's avatar Nikita Titov Committed by Guolin Ke
Browse files

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

* updated gitignore

* updated tree index with cat feature
parent 8d6666e0
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment