Skip to content

Instantly share code, notes, and snippets.

@ashenfad
Last active December 19, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashenfad/5979156 to your computer and use it in GitHub Desktop.
Save ashenfad/5979156 to your computer and use it in GitHub Desktop.
BigML Tree - Titanic Survival

A sunburst visualization of a BigML decision tree built on a dataset describing Titanic passengers and whether they survived.

The model uses BigML's upcoming automatic text processing to discover that passenger name honorifics (like "Mr.") are helpful for predicting survival.


The initial center circle represents the root of the tree. Each outer circle contains the children of the inner circle's nodes. The number of training instances captured by a node determine its arc length (or its size in radians).

Clicking on a node will zoom in to the subtree. After zooming in, selecting the new center point will zoom out one level.

<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: auto;
position: relative;
width: 960px;
background: #fff;
}
#color-controls {
font: 14px sans-serif;
position: absolute;
right: 10px;
top: 10px;
padding: 3px;
}
#color-controls div {
padding: 4px;
}
#hover-info {
font: 14px sans-serif;
position: absolute;
left: 10px;
top: 10px;
}
#summary-info {
font: 14px sans-serif;
position: absolute;
left: 10px;
bottom: 10px;
font: 12px sans-serif;
}
#summary-info div {
padding: 2px;
}
.split-predicate {
font-weight:bold;
border-bottom: 1px solid #DFDFDF;
padding: 7px;
}
.node-info {
margin-top: 10px;
}
.node-info td {
padding: 2px 7px 2px;
}
</style>
<body>
<div id="color-controls">
<form>
<div>
<input type="radio" name="mode" value="prediction" checked \>
<label>Prediction</label>
</div>
<div>
<input type="radio" name="mode" value="confidence"\>
<label id="cnf">Confidence</label>
</div>
<div>
<input type="radio" name="mode" value="split"\>
<label>Split Field</label>
</div>
</form>
</div>
<div id="hover-info"></div>
<div id="summary-info"></div>
</body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var width = 960,
height = 600,
radius = Math.min(width, height) / 2;
function hover_adjust(d, color) {
return d.hover ? d3.rgb(color).brighter(0.66) : color;
}
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height)
.append("g")
.attr("transform", "translate(" + width / 2 + "," + (height / 2 + 0) + ")");
function add_missing(d) {
if (d.children) {
var sum = 0;
for (i in d.children) {
sum += d.children[i].count;
d.children[i] = add_missing(d.children[i]);
}
var diff = d.count - sum;
if (diff > 0) {
missing = {"missing": true, "count": diff};
d.children.push(missing);
}
}
return d;
}
var partition = d3.layout.partition().value(function(d) { return d.count; });
var x = d3.scale.linear().range([0, 2 * Math.PI]);
var y = d3.scale.sqrt().range([0, radius]);
var arc = d3.svg.arc()
.startAngle(function(d) { return Math.max(0, Math.min(2 * Math.PI, x(d.x))); })
.endAngle(function(d) { return Math.max(0, Math.min(2 * Math.PI, x(d.x + d.dx))); })
.innerRadius(function(d) { return Math.max(0, y(d.y)); })
.outerRadius(function(d) { return Math.max(0, y(d.y + d.dy)); });
// Interpolate the scales!
function arcTween(d) {
var xd = d3.interpolate(x.domain(), [d.x, d.x + d.dx]),
yd = d3.interpolate(y.domain(), [d.y, 1]),
yr = d3.interpolate(y.range(), [d.y ? 20 : 0, radius]);
return function(d, i) {
return i
? function(t) { return arc(d); }
: function(t) { x.domain(xd(t)); y.domain(yd(t)).range(yr(t)); return arc(d); };
};
}
function find_minmax(node, attr) {
if (node.children) {
minmaxs = node.children.map(function (n) { return find_minmax(n, attr); });
min = Math.min.apply(null, minmaxs.map(function (mm) {return mm.min}));
max = Math.max.apply(null, minmaxs.map(function (mm) {return mm.max}));
return {"min": Math.min(min, node[attr]), "max": Math.max(max, node[attr])};
} else {
return {"min": node[attr], "max": node[attr]};
}
}
d3.json("titanic-model.json", function(error, root) {
var model = root;
var model_type = model.model_fields[root.objective_field].optype == "categorical" ?
"classification" : "regression";
var minmaxs = {};
if (model_type == "classification") {
minmaxs.confidence = find_minmax(model.root, "confidence");
} else {
// Hacky label switch for regression trees
document.getElementById("cnf").innerHTML = "Expected Error";
minmaxs.expected_error = find_minmax(model.root, "confidence");
minmaxs.output = find_minmax(model.root, "output");
}
model.root = add_missing(model.root);
var scale_pred = model_type == "classification" ?
d3.scale.category10() :
d3.scale.linear().domain([minmaxs.output.min,
minmaxs.output.max])
.range(["#222", "#2ee"]);
var scale_conf = model_type == "classification" ?
d3.scale.linear().domain([minmaxs.confidence.min,
minmaxs.confidence.max])
.range(["#d33", "#3d3"]) :
d3.scale.linear().domain([minmaxs.expected_error.max,
minmaxs.expected_error.min])
.range(["#d33", "#3d3"]);
var scale_split = d3.scale.category20b();
var color_lookup =
{"prediction": function(d) {
if (d.missing) {
return "#FFFFFF";
} else {
return hover_adjust(d, scale_pred(d.output));
}
},
"confidence": function(d) {
if (d.missing) {
return "#FFFFFF";
} else {
return hover_adjust(d, scale_conf(d.confidence));
}
},
"split": function(d) {
if (d.missing) {
return "#FFFFFF";
} else {
return hover_adjust(d, scale_split(d.predicate.field));
}
}
};
var color_fn = color_lookup["prediction"];
var path = svg.selectAll("path")
.data(partition.nodes(model.root))
.enter().append("path")
.attr("d", arc)
.style("fill", color_fn)
.style("stroke", "#fff")
.on("click", click)
.on("mouseover", mouseover)
.on("mouseout", mouseout);
var click_in_progress = false;
function click(d) {
mark_hover(d, false);
click_in_progress = true;
path.transition().duration(750).style("fill", color_fn).attrTween("d", arcTween(d));
setTimeout(function() {click_in_progress = false;}, 750);
}
d3.selectAll("input").on("change", change);
function change() {
color_fn = color_lookup[this.value];
path.transition().duration(250).style("fill", color_fn);
}
function mouseover(d) {
var split = d.predicate;
var split_msg;
if (split.field) {
if (split.term) {
if (split.value == 0 && split.operator == "<=") {
split_msg = model.model_fields[split.field].name +
" does not contain '" + split.term + "'";
} else if (split.value == 0 && split.operator == ">") {
split_msg = model.model_fields[split.field].name +
" contains '" + split.term + "'";
} else {
split_msg = model.model_fields[split.field].name + " contains "
+ "'" + split.term + "'" + " " + split.operator
+ " " + split.value + " time(s)";
}
} else {
split_msg = model.model_fields[split.field].name + " " +
split.operator + " " + split.value;
}
} else {
split_msg = "Tree Root";
}
var conf_msg = {"classification": "Confidence", "regression": "Expected Error"};
var hover = d3.select("#hover-info");
hover.append("div").attr("class", "split-predicate").text(split_msg);
tbody = hover.append("table").attr("class", "node-info").append("tbody");
var output = model_type == "classification" ? d.output : parseFloat(d.output.toFixed(3));
table_add(tbody, "Prediction", output);
table_add(tbody, conf_msg[model_type], parseFloat(d.confidence.toFixed(3)));
table_add(tbody, "Count", d.count);
mark_hover(d, true);
if (!click_in_progress) {
path.style("fill", color_fn);
}
var summ_doc = d3.select("#summary-info");
var summaries = summarize(d);
for (id in summaries) {
if (!summaries.hasOwnProperty(id)) { continue; }
var name = model.model_fields[id].name;
fs = summaries[id];
if (fs.terms) {
occurs = {};
not_occurs = {};
occurances = {};
for (term in fs.terms) {
ts = fs.terms[term];
ts.toString = function() { return JSON.stringify(this)};
var to;
if (occurances[ts]) {
to = occurances[ts];
} else {
to = {};
}
to[term] = true;
occurances[ts] = to;
}
for (ts in occurances) {
msg = name;
tsp = JSON.parse(ts);
if (tsp.max == 0) {
msg += " does not contain [ ";
} else {
msg += " contains [ ";
}
for (term in occurances[ts]) {
msg += term + " ";
}
msg += "]"
if (tsp.max != 0 && !(tsp.min == 0 && !isNum(tsp.max))) {
if (isNum(tsp.min)) {
msg += " more than " + tsp.min;
}
if (isNum(tsp.min) && isNum(tsp.max)) {
msg += " but";
}
if (isNum(tsp.max)) {
msg += " no more than " + tsp.max;
}
msg += " time(s)";
}
summ_doc.append("div").text(msg);
}
} else {
var msg = name;
if (isNum(fs.min)) {
msg = parseFloat(fs.min.toFixed(3)) + " < " + msg;
}
if (isNum(fs.max)) {
msg += " <= " + parseFloat(fs.max.toFixed(3));
}
if (fs.eq) {
msg += " = " + fs.eq;
} else if (fs.not_eq) {
msg += " !=";
var first = true;
for (category in fs.not_eq) {
if (first) {
first = false;
} else {
msg += "|";
}
if (!fs.not_eq.hasOwnProperty(category)) { continue; }
msg += " " + category;
}
}
summ_doc.append("div").text(msg);
}
}
}
function mouseout(d) {
d3.select("#hover-info").html("");
d3.select("#summary-info").html("");
mark_hover(d, false);
if (!click_in_progress) {
path.style("fill", color_fn);
}
}
function mark_hover (d, val) {
if (d.parent) { mark_hover(d.parent, val); };
d.hover = val;
}
});
d3.select(self.frameElement).style("height", height + "px");
function isNum(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
function summarize (node) {
var pred = node.predicate;
if (node.parent) {
var summary = summarize(node.parent);
switch(pred.operator) {
case "<=":
if (pred.term) {
if (summary[pred.field]) {
if (summary[pred.field].terms[pred.term]) {
var old_max = summary[pred.field].terms[pred.term].max;
max = isNum(old_max) ? Math.min(pred.value, old_max) : pred.value;
summary[pred.field].terms[pred.term].max = max;
} else {
summary[pred.field].terms[pred.term] = {"max": pred.value};
}
} else {
summary[pred.field] = {};
terms = {};
terms[pred.term] = {"max": pred.value};
summary[pred.field].terms = terms;
}
} else {
if (summary[pred.field]) {
var old_max = summary[pred.field].max;
max = isNum(old_max) ? Math.min(pred.value, old_max) : pred.value;
summary[pred.field].max = max;
} else {
terms = {};
terms[pred.term] = {"max": pred.value};
summary[pred.field] = {"max": pred.value};
}
}
break;
case ">":
if (pred.term) {
if (summary[pred.field]) {
if (summary[pred.field].terms[pred.term]) {
var old_min = summary[pred.field].terms[pred.term].min;
min = isNum(old_min) ? Math.max(pred.value, old_min) : pred.value;
summary[pred.field].terms[pred.term].min = min;
} else {
summary[pred.field].terms[pred.term] = {"min": pred.value};
}
} else {
summary[pred.field] = {};
terms = {};
terms[pred.term] = {"min": pred.value};
summary[pred.field].terms = terms;
}
} else {
if (summary[pred.field]) {
var old_min = summary[pred.field].min;
min = isNum(old_min) ? Math.max(pred.value, old_min) : pred.value;
summary[pred.field].min = min;
} else {
summary[pred.field] = {"min": pred.value};
}
}
break;
case "=":
summary[pred.field] = {"eq": pred.value};
break;
case "!=":
if (!summary[pred.field]) {
summary[pred.field] = {};
}
if (!summary[pred.field].not_eq) {
summary[pred.field].not_eq = {};
}
summary[pred.field].not_eq[pred.value] = true;
break;
}
return summary;
} else {
return {};
}
}
function table_add (table, field, val) {
var row = table.append("tr");
row.append("td").text(field);
row.append("td").text(val);
return row;
}
</script>
{"objective_fields":["000006"],"missing_strategy":"last_prediction","freeze_threshold":4096,"kind":"stree","dataset_id":"1373576434339","objective_histogram_size":32,"support_threshold":0,"missing_tokens":["","N/A","n/a","NULL","null","-","#DIV/0","#REF!","#NAME?","NIL","nil","NA","na","#VALUE!","#NULL!","NaN","#N/A","#NUM!","?"],"field_histogram_size":64,"root":{"confidence":0.65775,"children":[{"confidence":0.78079,"children":[{"confidence":0.55996,"output":"TRUE","predicate":{"field":"000002","operator":"=","value":"Deck"},"count":63,"objective_summary":{"categories":[["FALSE",20],["TRUE",43]]}},{"confidence":0.80107,"children":[{"confidence":0.81671,"children":[{"confidence":0.73021,"output":"FALSE","predicate":{"field":"000002","operator":"=","value":"Engine"},"count":325,"objective_summary":{"categories":[["TRUE",72],["FALSE",253]]}},{"confidence":0.83295,"children":[{"confidence":0.7628,"children":[{"confidence":0.76482,"output":"FALSE","predicate":{"field":"000001","operator":"<=","value":56.5},"count":304,"objective_summary":{"categories":[["TRUE",57],["FALSE",247]]}},{"confidence":0.20654,"output":"TRUE","predicate":{"field":"000001","operator":">","value":56.5},"count":1,"objective_summary":{"categories":[["TRUE",1]]}}],"output":"FALSE","predicate":{"term":"steward","field":"000005","operator":">","value":0},"count":306,"objective_summary":{"categories":[["TRUE",58],["FALSE",248]]}},{"confidence":0.8818,"children":[{"confidence":0.90568,"output":"FALSE","predicate":{"field":"000003","operator":"<=","value":3415},"count":434,"objective_summary":{"categories":[["TRUE",29],["FALSE",405]]}},{"confidence":0.38641,"children":[{"confidence":0.31267,"children":[{"confidence":0.48687,"output":"TRUE","predicate":{"field":"000001","operator":"<=","value":40},"count":7,"objective_summary":{"categories":[["FALSE",1],["TRUE",6]]}},{"confidence":0.43849,"output":"FALSE","predicate":{"field":"000001","operator":">","value":40},"count":3,"objective_summary":{"categories":[["FALSE",3]]}}],"output":"TRUE","predicate":{"field":"000001","operator":">","value":23.5},"count":10,"objective_summary":{"categories":[["FALSE",4],["TRUE",6]]}},{"confidence":0.60966,"output":"FALSE","predicate":{"field":"000001","operator":"<=","value":23.5},"count":6,"objective_summary":{"categories":[["FALSE",6]]}}],"output":"FALSE","predicate":{"field":"000003","operator":">","value":3415},"count":16,"objective_summary":{"categories":[["TRUE",6],["FALSE",10]]}}],"output":"FALSE","predicate":{"term":"steward","field":"000005","operator":"<=","value":0},"count":596,"objective_summary":{"categories":[["TRUE",55],["FALSE",541]]}}],"output":"FALSE","predicate":{"field":"000002","operator":"!=","value":"Engine"},"count":1039,"objective_summary":{"categories":[["TRUE",150],["FALSE",889]]}}],"output":"FALSE","predicate":{"field":"000002","operator":"!=","value":"1st Class"},"count":1364,"objective_summary":{"categories":[["TRUE",222],["FALSE",1142]]}},{"confidence":0.61008,"children":[{"confidence":0.51525,"children":[{"confidence":0.56607,"children":[{"confidence":0.7575,"output":"FALSE","predicate":{"field":"000003","operator":"<=","value":4010},"count":12,"objective_summary":{"categories":[["FALSE",12]]}},{"confidence":0.4796,"children":[{"confidence":0.34237,"output":"TRUE","predicate":{"field":"000003","operator":">","value":29950},"count":2,"objective_summary":{"categories":[["TRUE",2]]}},{"confidence":0.50141,"children":[{"confidence":0.43328,"children":[{"confidence":0.31267,"children":[{"confidence":0.30064,"children":[{"confidence":0.43849,"output":"FALSE","predicate":{"field":"000001","operator":">","value":19.5},"count":3,"objective_summary":{"categories":[["FALSE",3]]}},{"confidence":0.20654,"output":"TRUE","predicate":{"field":"000001","operator":"<=","value":19.5},"count":1,"objective_summary":{"categories":[["TRUE",1]]}}],"output":"FALSE","predicate":{"field":"000001","operator":"<=","value":24.5},"count":4,"objective_summary":{"categories":[["TRUE",1],["FALSE",3]]}},{"confidence":0.43649,"children":[{"confidence":0.20654,"output":"FALSE","predicate":{"field":"000001","operator":">","value":48},"count":1,"objective_summary":{"categories":[["FALSE",1]]}},{"confidence":0.56551,"output":"TRUE","predicate":{"field":"000001","operator":"<=","value":48},"count":5,"objective_summary":{"categories":[["TRUE",5]]}}],"output":"TRUE","predicate":{"field":"000001","operator":">","value":24.5},"count":6,"objective_summary":{"categories":[["FALSE",1],["TRUE",5]]}}],"output":"TRUE","predicate":{"field":"000003","operator":">","value":6665},"count":10,"objective_summary":{"categories":[["FALSE",4],["TRUE",6]]}},{"confidence":0.46616,"children":[{"confidence":0.30117,"children":[{"confidence":0.30064,"children":[{"confidence":0.43849,"output":"FALSE","predicate":{"term":"john","field":"000000","operator":"<=","value":0},"count":3,"objective_summary":{"categories":[["FALSE",3]]}},{"confidence":0.20654,"output":"TRUE","predicate":{"term":"john","field":"000000","operator":">","value":0},"count":1,"objective_summary":{"categories":[["TRUE",1]]}}],"output":"FALSE","predicate":{"field":"000003","operator":">","value":5950},"count":4,"objective_summary":{"categories":[["TRUE",1],["FALSE",3]]}},{"confidence":0.3538,"children":[{"confidence":0.43849,"output":"TRUE","predicate":{"term":"independent","field":"000005","operator":"<=","value":0},"count":3,"objective_summary":{"categories":[["TRUE",3]]}},{"confidence":0.34237,"output":"FALSE","predicate":{"term":"independent","field":"000005","operator":">","value":0},"count":2,"objective_summary":{"categories":[["FALSE",2]]}}],"output":"TRUE","predicate":{"field":"000003","operator":"<=","value":5950},"count":11,"objective_summary":{"categories":[["FALSE",4],["TRUE",7]]}}],"output":"TRUE","predicate":{"field":"000001","operator":"<=","value":33.5},"count":15,"objective_summary":{"categories":[["FALSE",7],["TRUE",8]]}},{"confidence":0.54785,"children":[{"confidence":0.34237,"output":"TRUE","predicate":{"field":"000001","operator":">","value":47},"count":2,"objective_summary":{"categories":[["TRUE",2]]}},{"confidence":0.63977,"output":"FALSE","predicate":{"field":"000001","operator":"<=","value":47},"count":16,"objective_summary":{"categories":[["TRUE",2],["FALSE",14]]}}],"output":"FALSE","predicate":{"field":"000001","operator":">","value":33.5},"count":18,"objective_summary":{"categories":[["TRUE",4],["FALSE",14]]}}],"output":"FALSE","predicate":{"field":"000003","operator":"<=","value":6665},"count":33,"objective_summary":{"categories":[["TRUE",12],["FALSE",21]]}}],"output":"FALSE","predicate":{"field":"000003","operator":"<=","value":10550},"count":43,"objective_summary":{"categories":[["TRUE",18],["FALSE",25]]}},{"confidence":0.64566,"output":"FALSE","predicate":{"field":"000003","operator":">","value":10550},"count":7,"objective_summary":{"categories":[["FALSE",7]]}}],"output":"FALSE","predicate":{"field":"000003","operator":"<=","value":29950},"count":50,"objective_summary":{"categories":[["TRUE",18],["FALSE",32]]}}],"output":"FALSE","predicate":{"field":"000003","operator":">","value":4010},"count":52,"objective_summary":{"categories":[["TRUE",20],["FALSE",32]]}}],"output":"FALSE","predicate":{"field":"000003","operator":">","value":3080},"count":64,"objective_summary":{"categories":[["TRUE",20],["FALSE",44]]}},{"confidence":0.40291,"children":[{"confidence":0.48687,"children":[{"confidence":0.20654,"output":"FALSE","predicate":{"term":"jakob","field":"000000","operator":">","value":0},"count":1,"objective_summary":{"categories":[["FALSE",1]]}},{"confidence":0.60966,"output":"TRUE","predicate":{"term":"jakob","field":"000000","operator":"<=","value":0},"count":6,"objective_summary":{"categories":[["TRUE",6]]}}],"output":"TRUE","predicate":{"field":"000001","operator":"<=","value":28.5},"count":7,"objective_summary":{"categories":[["FALSE",1],["TRUE",6]]}},{"confidence":0.36484,"children":[{"confidence":0.36199,"children":[{"confidence":0.413,"children":[{"confidence":0.34237,"output":"FALSE","predicate":{"term":"estate","field":"000005","operator":">","value":0},"count":2,"objective_summary":{"categories":[["FALSE",2]]}},{"confidence":0.48687,"children":[{"confidence":0.60966,"output":"TRUE","predicate":{"term":"gustaf","field":"000000","operator":"<=","value":0},"count":6,"objective_summary":{"categories":[["TRUE",6]]}},{"confidence":0.20654,"output":"FALSE","predicate":{"term":"gustaf","field":"000000","operator":">","value":0},"count":1,"objective_summary":{"categories":[["FALSE",1]]}}],"output":"TRUE","predicate":{"term":"estate","field":"000005","operator":"<=","value":0},"count":7,"objective_summary":{"categories":[["FALSE",1],["TRUE",6]]}}],"output":"TRUE","predicate":{"field":"000003","operator":"<=","value":2095},"count":17,"objective_summary":{"categories":[["FALSE",6],["TRUE",11]]}},{"confidence":0.38734,"children":[{"confidence":0.3542,"children":[{"confidence":0.56551,"output":"TRUE","predicate":{"field":"000003","operator":"<=","value":2500},"count":5,"objective_summary":{"categories":[["TRUE",5]]}},{"confidence":0.30064,"children":[{"confidence":0.20654,"output":"TRUE","predicate":{"term":"hugh","field":"000000","operator":">","value":0},"count":1,"objective_summary":{"categories":[["TRUE",1]]}},{"confidence":0.43849,"output":"FALSE","predicate":{"term":"hugh","field":"000000","operator":"<=","value":0},"count":3,"objective_summary":{"categories":[["FALSE",3]]}}],"output":"FALSE","predicate":{"field":"000003","operator":">","value":2500},"count":4,"objective_summary":{"categories":[["TRUE",1],["FALSE",3]]}}],"output":"TRUE","predicate":{"field":"000001","operator":">","value":42.5},"count":9,"objective_summary":{"categories":[["FALSE",3],["TRUE",6]]}},{"confidence":0.49743,"children":[{"confidence":0.62264,"children":[{"confidence":0.20654,"output":"TRUE","predicate":{"term":"gilbert","field":"000000","operator":">","value":0},"count":1,"objective_summary":{"categories":[["TRUE",1]]}},{"confidence":0.72246,"output":"FALSE","predicate":{"term":"gilbert","field":"000000","operator":"<=","value":0},"count":10,"objective_summary":{"categories":[["FALSE",10]]}}],"output":"FALSE","predicate":{"field":"000003","operator":"<=","value":2380},"count":11,"objective_summary":{"categories":[["TRUE",1],["FALSE",10]]}},{"confidence":0.34237,"output":"TRUE","predicate":{"field":"000003","operator":">","value":2380},"count":2,"objective_summary":{"categories":[["TRUE",2]]}}],"output":"FALSE","predicate":{"field":"000001","operator":"<=","value":42.5},"count":13,"objective_summary":{"categories":[["TRUE",3],["FALSE",10]]}}],"output":"FALSE","predicate":{"field":"000003","operator":">","value":2095},"count":22,"objective_summary":{"categories":[["TRUE",9],["FALSE",13]]}}],"output":"TRUE","predicate":{"field":"000003","operator":">","value":1985},"count":39,"objective_summary":{"categories":[["FALSE",19],["TRUE",20]]}},{"confidence":0.34237,"output":"FALSE","predicate":{"field":"000003","operator":"<=","value":1985},"count":2,"objective_summary":{"categories":[["FALSE",2]]}}],"output":"FALSE","predicate":{"field":"000001","operator":">","value":28.5},"count":41,"objective_summary":{"categories":[["TRUE",20],["FALSE",21]]}}],"output":"TRUE","predicate":{"field":"000003","operator":"<=","value":3080},"count":48,"objective_summary":{"categories":[["FALSE",22],["TRUE",26]]}}],"output":"FALSE","predicate":{"field":"000001","operator":"<=","value":49.5},"count":119,"objective_summary":{"categories":[["TRUE",47],["FALSE",72]]}},{"confidence":0.76421,"output":"FALSE","predicate":{"field":"000001","operator":">","value":49.5},"count":39,"objective_summary":{"categories":[["TRUE",4],["FALSE",35]]}}],"output":"FALSE","predicate":{"field":"000002","operator":"=","value":"1st Class"},"count":162,"objective_summary":{"categories":[["TRUE",51],["FALSE",111]]}}],"output":"FALSE","predicate":{"field":"000002","operator":"!=","value":"Deck"},"count":1526,"objective_summary":{"categories":[["TRUE",273],["FALSE",1253]]}}],"output":"FALSE","predicate":{"term":"mr","field":"000000","operator":">","value":0},"count":1589,"objective_summary":{"categories":[["TRUE",316],["FALSE",1273]]}},{"confidence":0.60117,"children":[{"confidence":0.875,"output":"TRUE","predicate":{"field":"000002","operator":"=","value":"1st Class"},"count":162,"objective_summary":{"categories":[["FALSE",12],["TRUE",150]]}},{"confidence":0.49246,"children":[{"confidence":0.75346,"output":"TRUE","predicate":{"field":"000002","operator":"=","value":"2nd Class"},"count":128,"objective_summary":{"categories":[["FALSE",22],["TRUE",106]]}},{"confidence":0.43849,"output":"FALSE","predicate":{"field":"000002","operator":"=","value":"Deck"},"count":3,"objective_summary":{"categories":[["FALSE",3]]}},{"confidence":0.85172,"children":[{"confidence":0.91799,"output":"FALSE","predicate":{"term":"cashier","field":"000005","operator":"<=","value":0},"count":43,"objective_summary":{"categories":[["FALSE",43]]}},{"confidence":0.34237,"output":"TRUE","predicate":{"term":"cashier","field":"000005","operator":">","value":0},"count":2,"objective_summary":{"categories":[["TRUE",2]]}}],"output":"FALSE","predicate":{"field":"000002","operator":"=","value":"A la Carte"},"count":45,"objective_summary":{"categories":[["TRUE",2],["FALSE",43]]}},{"confidence":0.47774,"children":[{"confidence":0.50001,"children":[{"confidence":0.50501,"children":[{"confidence":0.34237,"output":"TRUE","predicate":{"field":"000003","operator":"<=","value":578},"count":2,"objective_summary":{"categories":[["TRUE",2]]}},{"confidence":0.60058,"output":"FALSE","predicate":{"field":"000003","operator":">","value":578},"count":14,"objective_summary":{"categories":[["TRUE",2],["FALSE",12]]}}],"output":"FALSE","predicate":{"field":"000001","operator":">","value":39.5},"count":16,"objective_summary":{"categories":[["TRUE",4],["FALSE",12]]}},{"confidence":0.52436,"children":[{"confidence":0.51228,"children":[{"confidence":0.47343,"children":[{"confidence":0.33716,"children":[{"confidence":0.43849,"output":"FALSE","predicate":{"field":"000001","operator":">","value":31.5},"count":3,"objective_summary":{"categories":[["FALSE",3]]}},{"confidence":0.30117,"children":[{"confidence":0.43435,"children":[{"confidence":0.20654,"output":"FALSE","predicate":{"field":"000003","operator":">","value":1435},"count":1,"objective_summary":{"categories":[["FALSE",1]]}},{"confidence":0.49016,"output":"TRUE","predicate":{"field":"000003","operator":"<=","value":1435},"count":10,"objective_summary":{"categories":[["FALSE",2],["TRUE",8]]}}],"output":"TRUE","predicate":{"term":"labourer","field":"000005","operator":"<=","value":0},"count":11,"objective_summary":{"categories":[["FALSE",3],["TRUE",8]]}},{"confidence":0.5101,"output":"FALSE","predicate":{"term":"labourer","field":"000005","operator":">","value":0},"count":4,"objective_summary":{"categories":[["FALSE",4]]}}],"output":"TRUE","predicate":{"field":"000001","operator":"<=","value":31.5},"count":15,"objective_summary":{"categories":[["FALSE",7],["TRUE",8]]}}],"output":"FALSE","predicate":{"term":"servant","field":"000005","operator":"<=","value":0},"count":18,"objective_summary":{"categories":[["TRUE",8],["FALSE",10]]}},{"confidence":0.60058,"output":"FALSE","predicate":{"term":"servant","field":"000005","operator":">","value":0},"count":14,"objective_summary":{"categories":[["TRUE",2],["FALSE",12]]}}],"output":"TRUE","predicate":{"field":"000004","operator":"!=","value":"Cherbourg"},"count":150,"objective_summary":{"categories":[["FALSE",67],["TRUE",83]]}},{"confidence":0.55782,"output":"TRUE","predicate":{"field":"000004","operator":"=","value":"Cherbourg"},"count":33,"objective_summary":{"categories":[["FALSE",9],["TRUE",24]]}}],"output":"TRUE","predicate":{"field":"000003","operator":"<=","value":1725},"count":183,"objective_summary":{"categories":[["FALSE",76],["TRUE",107]]}},{"confidence":0.56551,"output":"TRUE","predicate":{"field":"000003","operator":">","value":1725},"count":5,"objective_summary":{"categories":[["TRUE",5]]}}],"output":"TRUE","predicate":{"field":"000001","operator":"<=","value":39.5},"count":188,"objective_summary":{"categories":[["FALSE",76],["TRUE",112]]}}],"output":"TRUE","predicate":{"field":"000003","operator":"<=","value":1805},"count":204,"objective_summary":{"categories":[["FALSE",88],["TRUE",116]]}},{"confidence":0.83024,"children":[{"confidence":0.18761,"children":[{"confidence":0.34237,"output":"TRUE","predicate":{"term":"master","field":"000000","operator":"<=","value":0},"count":2,"objective_summary":{"categories":[["TRUE",2]]}},{"confidence":0.30064,"children":[{"confidence":0.43849,"output":"FALSE","predicate":{"field":"000001","operator":">","value":4},"count":3,"objective_summary":{"categories":[["FALSE",3]]}},{"confidence":0.20654,"output":"TRUE","predicate":{"field":"000001","operator":"<=","value":4},"count":1,"objective_summary":{"categories":[["TRUE",1]]}}],"output":"FALSE","predicate":{"term":"master","field":"000000","operator":">","value":0},"count":4,"objective_summary":{"categories":[["TRUE",1],["FALSE",3]]}}],"output":"FALSE","predicate":{"term":"asplund","field":"000000","operator":">","value":0},"count":6,"objective_summary":{"categories":[["TRUE",3],["FALSE",3]]}},{"confidence":0.89504,"output":"FALSE","predicate":{"term":"asplund","field":"000000","operator":"<=","value":0},"count":50,"objective_summary":{"categories":[["TRUE",1],["FALSE",49]]}}],"output":"FALSE","predicate":{"field":"000003","operator":">","value":1805},"count":56,"objective_summary":{"categories":[["TRUE",4],["FALSE",52]]}}],"output":"FALSE","predicate":{"field":"000002","operator":"=","value":"3rd Class"},"count":260,"objective_summary":{"categories":[["TRUE",120],["FALSE",140]]}},{"confidence":0.65364,"output":"TRUE","predicate":{"field":"000002","operator":"=","value":"Victualling"},"count":21,"objective_summary":{"categories":[["FALSE",3],["TRUE",18]]}}],"output":"TRUE","predicate":{"field":"000002","operator":"!=","value":"1st Class"},"count":457,"objective_summary":{"categories":[["FALSE",211],["TRUE",246]]}}],"output":"TRUE","predicate":{"term":"mr","field":"000000","operator":"<=","value":0},"count":619,"objective_summary":{"categories":[["FALSE",223],["TRUE",396]]}}],"output":"FALSE","predicate":true,"count":2208,"objective_summary":{"categories":[["TRUE",712],["FALSE",1496]]}},"similarity_threshold":0.15,"model_fields":{"000004":{"preferred":true,"datatype":"string","optype":"categorical","name":"Joined","column_number":4},"000003":{"preferred":true,"datatype":"int32","optype":"numeric","name":"Fare","column_number":3},"000001":{"preferred":true,"datatype":"double","optype":"numeric","name":"Age","column_number":1},"000005":{"name":"Job","datatype":"string","preferred":true,"column_number":5,"term_analysis":{"enabled":true,"language":"en","case_sensitive":false,"stem_words":true,"use_stopwords":false},"optype":"text"},"000002":{"preferred":true,"datatype":"string","optype":"categorical","name":"Class/Dept","column_number":2},"000000":{"name":"Name","datatype":"string","preferred":true,"column_number":0,"term_analysis":{"enabled":true,"language":"none","case_sensitive":false},"optype":"text"},"000006":{"preferred":true,"datatype":"string","optype":"categorical","name":"Survived","column_number":6}},"split_criterion":"information_gain_mix","randomize":false,"locale":"en_US","split_score_threshold":1.0E-12,"node_threshold":512,"depth_threshold":20,"type":"classification","selective_pruning":false,"distribution":{"training":{"categories":[["TRUE",712],["FALSE",1496]]},"predictions":{"categories":[["TRUE",604],["FALSE",1604]]}},"fields":{"000000":{"name":"Name","datatype":"string","preferred":true,"column_number":0,"order":0,"term_analysis":{"enabled":true,"language":"none","case_sensitive":false},"summary":{"term_forms":{},"tag_cloud":{"gifford":2,"black":2,"lefebvre":6,"alma":2,"henry":84,"leon":2,"kantor":2,"violet":3,"goodwin":8,"ball":3,"young":3,"betros":3,"mackie":2,"cornelius":2,"lines":2,"mr":1589,"walter":25,"lennon":2,"herman":5,"andersen":3,"clarence":3,"wilhelm":4,"carl":6,"lam":2,"pauline":2,"r":5,"fortune":6,"barbara":4,"sage":11,"amelia":5,"hill":3,"read":3,"light":3,"alfred":49,"leo":4,"jennie":2,"allison":4,"matilda":4,"reginald":11,"wood":3,"rene":3,"arnold":5,"tannous":6,"drew":3,"parker":2,"elizabeth":29,"king":4,"crosby":4,"jane":9,"white":9,"leslie":4,"mallet":3,"barnes":3,"william":175,"sidney":11,"hugh":9,"hanora":3,"abbott":4,"arthur":44,"roland":3,"jean":8,"evans":5,"west":4,"parsons":3,"skoog":6,"robinson":3,"auguste":3,"petroff":2,"owen":5,"moubarek":3,"rogers":4,"einar":2,"colonel":4,"oreskovic":3,"hickman":3,"larsson":3,"hart":6,"martin":13,"richards":4,"christy":3,"houssein":2,"washington":3,"maggie":4,"williams":10,"karl":13,"collyer":3,"emile":2,"sawyer":2,"austin":4,"ross":3,"victor":10,"edwin":7,"katie":4,"benjamin":6,"kate":8,"mccarthy":4,"murdoch":2,"rosalie":3,"marie":13,"clement":2,"hunt":3,"jacques":2,"anthony":3,"morgan":4,"ryerson":6,"emest":4,"alfons":2,"james":88,"y":7,"gordon":5,"mauritz":2,"butt":3,"irene":3,"lillian":5,"hagland":2,"helen":9,"buckley":3,"winifred":2,"jacob":4,"dickson":3,"stanley":5,"daher":3,"olsen":6,"george":92,"jago":2,"scott":5,"kieran":2,"oskar":3,"hodges":2,"navratil":3,"frank":31,"wilfred":3,"eugene":5,"giles":4,"wilson":2,"stephen":7,"kelly":7,"a":22,"brown":11,"john":133,"morris":3,"svensson":4,"sarah":3,"peter":14,"lee":4,"agnes":6,"elin":3,"augustus":6,"ann":3,"johnston":5,"bridget":10,"clench":2,"allen":7,"peacock":3,"penasco":2,"louch":2,"foley":4,"jones":6,"hannah":4,"mccoy":3,"jessie":4,"giuseppe":5,"knight":3,"c":6,"ryan":3,"delia":6,"katherine":7,"fleming":3,"harris":11,"dr":10,"bernard":4,"ellen":11,"emily":7,"francis":21,"gustaf":6,"clarke":3,"gladys":3,"luigi":4,"master":61,"caroline":4,"boulos":5,"connor":4,"hanna":5,"samaan":3,"erik":3,"joseph":52,"julian":3,"gilbert":5,"gill":3,"hoyt":3,"danbom":3,"b":5,"vanderplancke":4,"eugenie":3,"edvard":4,"minahan":3,"cardeza":2,"f":13,"mary":42,"emma":5,"olive":3,"hulda":2,"phillips":6,"emilio":5,"alexander":20,"roberts":4,"klasen":3,"lawrence":3,"jakob":4,"annie":14,"palsson":5,"herbert":16,"g":12,"moran":2,"bishop":3,"malkolm":2,"elisabeth":7,"johan":21,"nora":5,"harper":4,"isaac":2,"simmons":4,"d":4,"nakid":3,"rice":9,"warren":3,"edgar":7,"augusta":5,"compton":3,"thayer":3,"keane":3,"susan":2,"fitzpatrick":2,"julia":4,"frolicher":3,"e":16,"miriam":2,"lucy":4,"wells":3,"viktor":3,"wiklund":2,"franklin":3,"mlle":2,"mcgough":2,"may":7,"bessie":3,"barker":3,"constance":5,"stone":3,"harder":3,"becker":4,"hold":2,"louisa":3,"charlotte":4,"bailey":4,"johannes":7,"dennis":4,"nichols":3,"catherine":13,"clifford":5,"l":7,"lane":3,"de":7,"khalil":3,"marion":4,"dodge":3,"ethel":4,"vilhelm":2,"carlsson":3,"panula":6,"quick":3,"j":44,"andrew":10,"moore":8,"jose":4,"m":8,"greenfield":2,"carlo":4,"alice":12,"august":9,"howard":5,"smith":16,"harold":7,"elias":9,"norman":6,"dean":5,"eleanor":3,"margaret":15,"mrs":210,"davis":4,"louise":8,"touma":3,"andersson":10,"saunders":4,"laroche":4,"jensen":5,"harrison":3,"h":28,"robert":35,"josef":4,"ernst":6,"nils":6,"widener":3,"brien":3,"ralph":3,"baxter":4,"philip":8,"o":14,"watson":6,"johansson":6,"patrick":15,"theodore":2,"edvin":5,"sigrid":3,"ford":11,"leonard":14,"matthew":3,"webber":3,"olsson":3,"spedden":3,"billiard":3,"clark":3,"crispin":2,"nicola":3,"sig":43,"hudson":2,"antti":2,"chapman":5,"cor":3,"rothschild":2,"lloyd":2,"cooper":2,"chronopoulos":2,"maurice":4,"lauritz":2,"laurence":3,"nilsson":3,"wick":3,"samuel":23,"braund":2,"jenny":2,"bourke":3,"jussila":3,"carr":2,"hocking":4,"hays":3,"percy":11,"charles":90,"nellie":7,"campbell":3,"ada":6,"frederick":54,"bertram":11,"hall":4,"baptiste":4,"major":4,"kristina":2,"mathias":3,"montague":2,"thomas":90,"davidson":2,"bird":2,"vera":2,"edith":9,"middleton":2,"abraham":6,"davies":11,"gerios":4,"ali":4,"newell":3,"madeleine":3,"cacic":4,"marian":2,"hubert":3,"tom":3,"wright":4,"grace":2,"luka":2,"ilmakangas":2,"frances":4,"daniel":7,"ernest":33,"bonnell":2,"v":3,"fr":7,"douglas":6,"simon":3,"emil":5,"sandstrom":3,"donald":4,"maria":16,"rowe":4,"leopold":3,"ruth":4,"amy":3,"bradley":4,"mellinger":2,"carter":7,"archibald":5,"richard":32,"murphy":3,"harry":29,"w":37,"oliver":4,"spencer":4,"ii":3,"edmond":3,"bengtsson":2,"anna":17,"daly":3,"andre":3,"roger":3,"christopher":3,"coutts":3,"youssef":4,"denis":2,"eliza":4,"meyer":3,"t":7,"georges":5,"thompson":4,"van":11,"taylor":13,"florence":7,"david":11,"olof":4,"thorne":3,"anderson":5,"goldsmith":4,"sofia":6,"mabel":5,"frauenthal":3,"fox":4,"lewis":5,"neal":3,"paul":6,"elsie":4,"cook":3,"martha":4,"pearce":3,"karlsson":3,"jr":9,"giovanni":3,"blake":3,"baclini":4,"ward":7,"andreas":2,"sullivan":2,"julius":3,"peder":2,"long":3,"taussig":3,"adele":2,"chaffee":2,"cavendish":2,"kink":5,"miss":270,"adolf":4,"andrews":3,"thornton":2,"edward":68,"godfrey":2,"ida":6,"louis":6,"albert":34,"ivan":6,"lalio":2,"johnson":7,"beattie":2,"asplund":8,"cribb":2,"dorothy":4,"ware":4,"michael":7,"oscar":4,"edmund":2,"hansen":6,"marvin":2,"p":3,"sara":2,"veal":3,"antonine":2,"impe":3,"gustafsson":5,"gertrude":3,"rosblom":3,"s":6,"caldwell":3,"francesco":3,"bertha":6,"percival":5,"mason":2,"cunningham":3,"hans":4,"flynn":3,"anne":8,"burke":3,"pierre":5,"cecil":3,"graham":5},"missing_count":0},"optype":"text"},"000001":{"preferred":true,"summary":{"standard_deviation":11.78309,"mean":29.91592,"median":28.77918,"minimum":0,"sum_squares":2273194.61,"missing_count":9,"bins":[[0.57619,21],[2.40909,22],[4.31579,19],[6.69231,13],[8.52632,19],[10.5,12],[12.5,8],[14.52381,21],[16.57576,66],[18.51261,119],[20.50311,161],[22.42529,174],[24.46067,178],[26.49673,153],[28.44643,168],[30.41765,170],[32.40288,139],[35.39565,230],[39.25434,173],[42.32836,67],[44.53448,58],[46.45946,37],[48.41026,39],[50.38462,26],[52.25,16],[54.45,20],[56.54545,11],[59.46429,28],[63.09524,21],[66.25,4],[70.4,5],[74,1]],"sum":65785.1,"population":2199,"maximum":74,"variance":138.84125,"splits":[6.78981,15.51592,17.55471,18.75882,19.78967,20.65126,21.47403,22.19231,23.00633,23.83205,24.57523,25.40281,26.28421,27.18135,27.98149,28.77918,29.62674,30.35564,31.23689,32.10886,33.14472,34.37121,35.41958,36.47909,38.02014,39.30014,41.07406,43.09555,45.62986,49.16016,55.77627]},"datatype":"double","order":1,"optype":"numeric","name":"Age","column_number":1},"000002":{"preferred":true,"summary":{"missing_count":0,"categories":[["3rd Class",708],["Victualling",431],["Engine",325],["1st Class",324],["2nd Class",285],["A la Carte",69],["Deck",66]]},"datatype":"string","order":2,"optype":"categorical","name":"Class/Dept","column_number":2},"000003":{"preferred":true,"summary":{"standard_deviation":4032.90362,"mean":2606.47792,"median":1121.62645,"minimum":245,"sum_squares":29751663753,"missing_count":917,"bins":[[317,3],[628.41412,524],[1086.36508,189],[1546.85185,54],[1989.15033,153],[2365.84615,65],[2745.78947,19],[3088.57143,28],[3613.63636,11],[3998.06452,31],[4359.16667,24],[4719.33333,15],[5054.28571,7],[5395.88235,17],[5727.27273,11],[6058.46154,26],[6385.33333,15],[6680,3],[7050,11],[7720,2],[8220,3],[8572,10],[9270,4],[10441.66667,12],[11300,3],[11766.66667,9],[12700,4],[16300,9],[17100,4],[19100,8],[20300,13],[39600,4]],"sum":3364963,"population":1291,"maximum":39600,"variance":1.626431161095E7,"splits":[552.8736,559.00397,591.0261,597.93353,599.67432,605.75,609.67196,611.24069,619.8766,624.94093,692.75,809.65502,891.15309,998.66876,1027.3546,1121.62645,1208.81949,1446.22626,1647.84162,1970.77396,2013.3708,2052.20037,2235.73908,2420.17984,2988.38883,3841.00505,4361.41883,5368.35365,6129.40179,8271.45833,12630.49517]},"datatype":"int32","order":3,"optype":"numeric","name":"Fare","column_number":3},"000004":{"preferred":true,"summary":{"missing_count":3,"categories":[["Southampton",1613],["Cherbourg",274],["Belfast",198],["Queenstown",120]]},"datatype":"string","order":4,"optype":"categorical","name":"Joined","column_number":4},"000005":{"name":"Job","datatype":"string","preferred":true,"column_number":5,"order":5,"term_analysis":{"enabled":true,"language":"en","case_sensitive":false,"stem_words":true,"use_stopwords":false},"summary":{"term_forms":{"grocer":["grocers"],"engineer":["enginer"]},"tag_cloud":{"minister":8,"3rd":10,"roast":4,"priest":8,"miner":14,"plate":10,"seaman":47,"boots":9,"arms":2,"manager":6,"6th":3,"personal":21,"hole":4,"junior":12,"deck":6,"cashier":2,"groom":3,"mechanical":3,"maid":20,"landowner":3,"4th":7,"musician":10,"servant":29,"verandah":2,"sportsman":2,"chef":3,"plumber":3,"ironworker":2,"extra":4,"independent":12,"entre":2,"storekeeper":14,"assistant":86,"politician":2,"turkish":5,"maker":2,"grill":2,"butler":3,"housekeeper":10,"trimmer":75,"class":4,"chief":12,"mess":6,"governess":2,"pugilist":2,"lift":4,"sales":2,"painter":6,"officer":7,"cleaner":2,"labourer":210,"farm":49,"military":4,"surgeon":2,"attendant":3,"quartermaster":7,"farmer":48,"master":3,"waiter":35,"messman":2,"carpenter":14,"ship":2,"housewife":6,"scholar":7,"barman":3,"senior":8,"bricklayer":3,"able":29,"restaurant":2,"presser":2,"fireman":176,"blacksmith":3,"buyer":3,"tailor":5,"re":2,"pastry":2,"purser":2,"stewardess":20,"couturi":2,"grocer":3,"bed":47,"dressmaker":2,"stoker":162,"joiner":14,"larder":3,"bell":3,"banker":3,"confectioner":3,"porter":7,"5th":4,"scullion":15,"smoke":3,"engineer":40,"2nd":10,"property":4,"clerk":17,"stockbroker":3,"decorator":5,"leading":13,"pantryman":10,"manufacturer":4,"barber":4,"controller":2,"lounge":3,"gentleman":5,"chemist":2,"boilermaker":2,"baker":18,"dairy":3,"butcher":10,"greaser":33,"shoemaker":5,"lawyer":4,"real":4,"secretary":2,"cutter":2,"doctor":4,"1st":2,"nursemaid":2,"shop":2,"postal":5,"vegetable":5,"estate":5,"boy":4,"jeweller":5,"steward":312,"soup":2,"developer":4,"means":12,"chauffeur":6,"salesman":2,"passage":2,"clothes":2,"merchant":9,"reception":2,"carver":2,"hotelier":3,"cook":37,"gardener":4,"boatswain":2,"lookout":6,"telegraphist":2,"singer":2,"glory":4,"glass":3,"fitter":4,"window":2,"saloon":143,"coach":2,"businessman":24,"printer":3,"pantry":6,"bath":12,"quarryman":2,"kitchen":6,"electrician":9,"writer":3,"mason":5,"journalist":4,"worker":7,"dealer":4},"missing_count":648},"optype":"text"},"000006":{"preferred":true,"summary":{"missing_count":0,"categories":[["FALSE",1496],["TRUE",712]]},"datatype":"string","order":6,"optype":"categorical","name":"Survived","column_number":6}},"z_statistic":2,"importance":[["000000",0.41221],["000005",0.26595],["000002",0.16561],["000003",0.12883],["000001",0.0274],["000004",0]],"objective_field":"000006","input_fields":["000000","000001","000002","000003","000004","000005"],"stat_pruning":true,"split_early":true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment