Skip to content

Commit 547d0a6

Browse files
committed
Added a decision surface of sorts to explain prediction
1 parent 0b6a3b4 commit 547d0a6

13 files changed

+679
-57
lines changed

.DS_Store

0 Bytes
Binary file not shown.

Sklearn/.DS_Store

0 Bytes
Binary file not shown.

Sklearn/DecisionTrees/.DS_Store

2 KB
Binary file not shown.

Sklearn/DecisionTrees/.ipynb_checkpoints/DecisionTreeAnatomy-checkpoint.ipynb

Lines changed: 380 additions & 35 deletions
Large diffs are not rendered by default.

Sklearn/DecisionTrees/DecisionTreeAnatomy.ipynb

Lines changed: 263 additions & 22 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
digraph Tree {
2+
node [shape=box, style="filled", color="black"] ;
3+
0 [label = "Root Node", fillcolor="cyan"] ;
4+
1 [label = "Leaf/Terminal\nNode", fillcolor="springgreen"] ;
5+
0 -> 1 [labeldistance=2.5, labelangle=45, headlabel="True"] ;
6+
2 [label="Decision Node", fillcolor="pink"] ;
7+
0 -> 2 [labeldistance=2.5, labelangle=-45, headlabel="False"] ;
8+
3 [label = "Leaf/Terminal\nNode", fillcolor="springgreen"] ;
9+
2 -> 3 ;
10+
4 [label = "Leaf/Terminal\nNode", fillcolor="springgreen"] ;
11+
2 -> 4 ;
12+
}
17.7 KB
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
digraph Tree {
2+
node [shape=box] ;
3+
0 [label="petal width (cm) <= 0.8\ngini = 0.665\nsamples = 112\nvalue = [37, 34, 41]\nclass = virginica"] ;
4+
1 [label="gini = 0.0\nsamples = 37\nvalue = [37, 0, 0]\nclass = setosa"] ;
5+
0 -> 1 [labeldistance=2.5, labelangle=45, headlabel="True"] ;
6+
2 [label="petal length (cm) <= 4.95\ngini = 0.496\nsamples = 75\nvalue = [0, 34, 41]\nclass = virginica"] ;
7+
0 -> 2 [labeldistance=2.5, labelangle=-45, headlabel="False"] ;
8+
3 [label="gini = 0.153\nsamples = 36\nvalue = [0, 33, 3]\nclass = versicolor"] ;
9+
2 -> 3 ;
10+
4 [label="gini = 0.05\nsamples = 39\nvalue = [0, 1, 38]\nclass = virginica"] ;
11+
2 -> 4 ;
12+
}
44.1 KB
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
digraph Tree {
2+
node [shape=box, style="filled", color="black"] ;
3+
0 [label="Is the petal length (cm) <= 2.35?", fillcolor="pink"] ;
4+
1 [label="setosa", fillcolor="springgreen"] ;
5+
0 -> 1 [labeldistance=2.5, labelangle=45, headlabel="True"] ;
6+
2 [label="Is the petal length (cm) <= 4.95", fillcolor="pink"] ;
7+
0 -> 2 [labeldistance=2.5, labelangle=-45, headlabel="False"] ;
8+
3 [label="versicolor", fillcolor="springgreen"] ;
9+
2 -> 3 [labeldistance=2.5, labelangle=45, headlabel="True"] ;
10+
4 [label="virginica", fillcolor="springgreen"] ;
11+
2 -> 4 [labeldistance=2.5, labelangle=-45, headlabel="False"] ;
12+
}

0 commit comments

Comments
 (0)