Skip to content

Commit

Permalink
Take into account amueller comments
Browse files Browse the repository at this point in the history
  • Loading branch information
arjoly committed Oct 21, 2015
1 parent c9888a6 commit ec8fbef
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/tree/plot_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
The decision tree structure can be analysed to gain further insight on the
relation between the features and the target to predict. In this example, we
show how to retrieve:
- the binary tree structure;
- the depth of each node and whether or not it's a leaf.
- the nodes that were reached by a sample using the ``decision_path``
method;
- the leaf that was reached by a sample using the apply method;
- the rules that were used to predict a sample;
- the decision path shared by a group of samples.
- the binary tree structure;
- the depth of each node and whether or not it's a leaf;
- the nodes that were reached by a sample using the ``decision_path`` method;
- the leaf that was reached by a sample using the apply method;
- the rules that were used to predict a sample;
- the decision path shared by a group of samples.
"""
import numpy as np
Expand Down Expand Up @@ -129,7 +129,7 @@

common_node_id = np.arange(n_nodes)[common_nodes]

print("\nThe following sample %s shares the following node %s in the tree"
print("\nThe following sample %s share the node %s in the tree"
% (sample_ids, common_node_id))
print("It is %s %% of all nodes."
% (len(common_node_id) / n_nodes * 100,))

0 comments on commit ec8fbef

Please sign in to comment.