Unverified Commit 15566421 authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[examples] Update example notebook (#2391)

* updated default value for precision in plot_importance function

* fixed typo

* updated example notebook
parent ad8e8ccc
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -32,7 +32,7 @@ def plot_importance(booster, ax=None, height=0.2,
xlabel='Feature importance', ylabel='Features',
importance_type='split', max_num_features=None,
ignore_zero=True, figsize=None, grid=True,
precision=None, **kwargs):
precision=3, **kwargs):
"""Plot model's feature importances.
Parameters
......@@ -70,7 +70,7 @@ def plot_importance(booster, ax=None, height=0.2,
Figure size.
grid : bool, optional (default=True)
Whether to add a grid for axes.
precision : int or None, optional (default=None)
precision : int or None, optional (default=3)
Used to restrict the display of floating point values to a certain precision.
**kwargs
Other parameters passed to ``ax.barh()``.
......@@ -440,7 +440,7 @@ def _to_graphviz(tree_info, show_info, feature_names, precision=3, constraints=N
if "internal_count" in tree_info['tree_structure']:
add(tree_info['tree_structure'], tree_info['tree_structure']["internal_count"])
else:
raise Exception("Cannnot plot trees with no split")
raise Exception("Cannot plot trees with no split")
if constraints:
# "#ddffdd" is light green, "#ffdddd" is light red
......
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