Skip to content

Instantly share code, notes, and snippets.

@ashenfad
Last active December 15, 2015 08:59
Show Gist options
  • Save ashenfad/5235174 to your computer and use it in GitHub Desktop.
Save ashenfad/5235174 to your computer and use it in GitHub Desktop.
BigML Tree - Adult Data

A sunburst visualization of a BigML decision tree built on the adult census dataset.

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.

{"public_dataset": false, "code": 200, "locale": "en-US", "short_url": "", "image": "gallery/model.png", "job_type": 400, "private": true, "dataset": "dataset/514fb983035d0731be000070", "fields_meta": {"count": 14, "total": 14, "limit": 1000, "offset": 0}, "white_box": false, "dataset_id": "514fb983035d0731be000070", "randomize": false, "id": "514fb9b2035d0731c100008e", "number_of_predictions": 0, "category": 0, "modified_fields": {}, "rows": 32561, "out_of_bag": false, "ordering": 0, "fields_to_show": [{"optype": "numeric", "is_objective": false, "name": "age", "datatype_name": "Numeric", "tooltip": "Numeric", "stats": [["Minimum", "17.00"], ["Mean", "38.58"], ["Median", "37.03"], ["Maximum", "90.00"], ["Std dev", "13.64"]], "id": "000000", "css": "numeric type_label datatype-tooltip"}, {"optype": "categorical", "is_objective": false, "name": "workclass", "datatype_name": "Categorical", "tooltip": "Categorical", "id": "000001", "css": "categorical type_label datatype-tooltip"}, {"optype": "numeric", "is_objective": false, "name": "fnlwgt", "datatype_name": "Numeric", "tooltip": "Numeric", "stats": [["Minimum", "12,285.00"], ["Mean", "189,778.37"], ["Median", "178,324.87"], ["Maximum", "1,484,705.00"], ["Std dev", "105,549.98"]], "id": "000002", "css": "numeric type_label datatype-tooltip"}, {"optype": "categorical", "is_objective": false, "name": "education", "datatype_name": "Categorical", "tooltip": "Categorical", "id": "000003", "css": "categorical type_label datatype-tooltip"}, {"optype": "numeric", "is_objective": false, "name": "education-num", "datatype_name": "Numeric", "tooltip": "Numeric", "stats": [["Minimum", "1.00"], ["Mean", "10.08"], ["Median", "9.73"], ["Maximum", "16.00"], ["Std dev", "2.57"]], "id": "000004", "css": "numeric type_label datatype-tooltip"}, {"optype": "categorical", "is_objective": false, "name": "marital-status", "datatype_name": "Categorical", "tooltip": "Categorical", "id": "000005", "css": "categorical type_label datatype-tooltip"}, {"optype": "categorical", "is_objective": false, "name": "occupation", "datatype_name": "Categorical", "tooltip": "Categorical", "id": "000006", "css": "categorical type_label datatype-tooltip"}, {"optype": "categorical", "is_objective": false, "name": "relationship", "datatype_name": "Categorical", "tooltip": "Categorical", "id": "000007", "css": "categorical type_label datatype-tooltip"}, {"optype": "categorical", "is_objective": false, "name": "race", "datatype_name": "Categorical", "tooltip": "Categorical", "id": "000008", "css": "categorical type_label datatype-tooltip"}, {"optype": "categorical", "is_objective": false, "name": "sex", "datatype_name": "Categorical", "tooltip": "Categorical", "id": "000009", "css": "categorical type_label datatype-tooltip"}, {"optype": "numeric", "is_objective": false, "name": "capital-gain", "datatype_name": "Numeric", "tooltip": "Numeric", "stats": [["Minimum", "0.00"], ["Mean", "1,077.65"], ["Median", "5.30"], ["Maximum", "99,999.00"], ["Std dev", "7,385.29"]], "id": "00000a", "css": "numeric type_label datatype-tooltip"}, {"optype": "numeric", "is_objective": false, "name": "capital-loss", "datatype_name": "Numeric", "tooltip": "Numeric", "stats": [["Minimum", "0.00"], ["Mean", "87.30"], ["Median", "3.84"], ["Maximum", "4,356.00"], ["Std dev", "402.96"]], "id": "00000b", "css": "numeric type_label datatype-tooltip"}, {"optype": "numeric", "is_objective": false, "name": "hours-per-week", "datatype_name": "Numeric", "tooltip": "Numeric", "stats": [["Minimum", "1.00"], ["Mean", "40.44"], ["Median", "40.06"], ["Maximum", "99.00"], ["Std dev", "12.35"]], "id": "00000c", "css": "numeric type_label datatype-tooltip"}, {"optype": "categorical", "is_objective": true, "name": "income", "datatype_name": "Categorical", "tooltip": "Categorical", "id": "00000e", "css": "categorical type_label datatype-tooltip"}], "views": 0, "size": 3974460, "range": [1, 32561], "credits_per_prediction": 0.0, "source": "source/514fb97b035d0731bf000049", "number_of_public_predictions": 0, "sample_rate": 1.0, "objective_fields": ["00000e"], "user_name": "ashenfad", "columns": 14, "selective_pruning": false, "status": {"progress": 1.0, "message": "The model has been created", "code": 5, "elapsed": 17997}, "updated": "2013-03-25T02:43:16.540000", "description": "", "tags": [], "price": 0.0, "excluded_fields": [], "cloned": false, "credits": 15.161361694335938, "stat_pruning": true, "objective_field": "00000e", "clones": 0, "resource": "model/514fb9b2035d0731c100008e", "name": "Adult Model", "created": "Mon, 25 Mar 2013 02:42:58 +0000", "url": "", "dataset_status": true, "source_status": true, "number_of_evaluations": 0, "max_columns": 15, "max_rows": 32561, "input_fields": ["000000", "000001", "000002", "000003", "000004", "000005", "000006", "000007", "000008", "000009", "00000a", "00000b", "00000c"], "published": null, "source_id": "514fb97b035d0731bf000049", "model": {"kind": "stree", "missing_strategy": "Last prediction", "importance": [["000004", 0.62007], ["00000a", 0.24553], ["00000b", 0.06077], ["000006", 0.04456], ["00000c", 0.00755], ["000000", 0.00751], ["000001", 0.00404], ["000003", 0.00378], ["000002", 0.00343], ["000008", 0.00131], ["000007", 0.00076], ["000009", 0.0007], ["000005", 0]], "fields": {"000006": {"optype": "categorical", "name": "occupation", "datatype": "string", "preferred": true, "summary": {"missing_count": 1843, "categories": [["Prof-specialty", 4140], ["Craft-repair", 4099], ["Exec-managerial", 4066], ["Adm-clerical", 3770], ["Sales", 3650], ["Other-service", 3295], ["Machine-op-inspct", 2002], ["Transport-moving", 1597], ["Handlers-cleaners", 1370], ["Farming-fishing", 994], ["Tech-support", 928], ["Protective-serv", 649], ["Priv-house-serv", 149], ["Armed-Forces", 9]]}, "column_number": 6, "order": 6}, "000007": {"optype": "categorical", "name": "relationship", "datatype": "string", "preferred": true, "summary": {"missing_count": 0, "categories": [["Husband", 13193], ["Not-in-family", 8305], ["Own-child", 5068], ["Unmarried", 3446], ["Wife", 1568], ["Other-relative", 981]]}, "column_number": 7, "order": 7}, "000004": {"optype": "numeric", "name": "education-num", "datatype": "int8", "preferred": true, "summary": {"sum_squares": 3524363, "missing_count": 0, "sum": 328237, "median": 9.72591, "maximum": 16, "minimum": 1, "standard_deviation": 2.57272, "variance": 6.61889, "counts": [[1, 51], [2, 168], [3, 333], [4, 646], [5, 514], [6, 933], [7, 1175], [8, 433], [9, 10501], [10, 7291], [11, 1382], [12, 1067], [13, 5355], [14, 1723], [15, 576], [16, 413]], "population": 32561, "mean": 10.08068}, "column_number": 4, "order": 4}, "000005": {"optype": "categorical", "name": "marital-status", "datatype": "string", "preferred": true, "summary": {"missing_count": 0, "categories": [["Married-civ-spouse", 14976], ["Never-married", 10683], ["Divorced", 4443], ["Separated", 1025], ["Widowed", 993], ["Married-spouse-absent", 418], ["Married-AF-spouse", 23]]}, "column_number": 5, "order": 5}, "000002": {"optype": "numeric", "name": "fnlwgt", "datatype": "int32", "preferred": true, "summary": {"sum_squares": 1535455764504374, "splits": [33631.93739, 46333.52182, 61746.4151, 80116.48339, 94732.99449, 103325.48658, 111120.46266, 117914.81294, 125456.51326, 134926.65538, 143842.36904, 152097.74521, 160141.14006, 167071.41948, 173429.51037, 178324.87111, 184388.67039, 189804.6267, 195161.4311, 201001.21244, 207858.66517, 215916.53232, 225883.07807, 237147.02629, 250407.99354, 267279.65108, 285472.95073, 308011.13291, 334537.95717, 362918.14982, 413480.32889], "missing_count": 0, "sum": 6179373392, "median": 178324.87111, "maximum": 1484705, "minimum": 12285, "standard_deviation": 105549.9777, "variance": 11140797791.84189, "population": 32561, "bins": [[44526.85774, 3613], [82816.93478, 1334], [112485.41028, 4843], [150088.06265, 4437], [190025.64982, 8130], [237241.91728, 3929], [281194.40665, 1864], [311126.27784, 925], [344922.51576, 1650], [385529.10877, 616], [421852.79123, 570], [463589.80928, 194], [503605.06316, 190], [554162.14286, 91], [598800.95, 60], [652492.28947, 38], [700468, 26], [748004, 19], [803628.28571, 7], [856317.25, 4], [889965, 1], [918003.25, 4], [969190, 3], [1034999, 3], [1091484, 2], [1125613, 1], [1172992.5, 2], [1226583, 1], [1268339, 1], [1366120, 1], [1455435, 1], [1484705, 1]], "mean": 189778.36651}, "column_number": 2, "order": 2}, "000003": {"optype": "categorical", "name": "education", "datatype": "string", "preferred": true, "summary": {"missing_count": 0, "categories": [["HS-grad", 10501], ["Some-college", 7291], ["Bachelors", 5355], ["Masters", 1723], ["Assoc-voc", 1382], ["11th", 1175], ["Assoc-acdm", 1067], ["10th", 933], ["7th-8th", 646], ["Prof-school", 576], ["9th", 514], ["12th", 433], ["Doctorate", 413], ["5th-6th", 333], ["1st-4th", 168], ["Preschool", 51]]}, "column_number": 3, "order": 3}, "000000": {"optype": "numeric", "name": "age", "datatype": "int8", "preferred": true, "summary": {"sum_squares": 54526623, "splits": [18.58199, 20.00208, 21.38779, 22.6937, 23.89609, 25.137, 26.40151, 27.62339, 28.8206, 30.03925, 31.20051, 32.40167, 33.57212, 34.72468, 35.87617, 37.03324, 38.24651, 39.49294, 40.76573, 42.0444, 43.3639, 44.75256, 46.13703, 47.60107, 49.39145, 51.09725, 53.14627, 55.56526, 58.35547, 61.50785, 66.43583], "missing_count": 0, "sum": 1256257, "median": 37.03324, "maximum": 90, "minimum": 17, "standard_deviation": 13.64043, "variance": 186.0614, "population": 32561, "bins": [[18.75643, 2410], [21.51515, 1485], [23.47642, 1675], [25.48278, 1626], [27.5094, 1702], [29.51434, 1674], [31.48252, 1716], [33.50312, 1761], [35.5062, 1774], [37.4908, 1685], [39.49317, 1610], [41.49118, 1588], [43.48461, 1494], [46.38942, 2722], [50.4325, 2252], [53.47213, 879], [55.46624, 785], [57.50552, 724], [59.46777, 667], [61.46237, 558], [63.47489, 438], [65.45732, 328], [67.4428, 271], [69.45178, 197], [71.48201, 139], [73.44348, 115], [75.50549, 91], [77.44231, 52], [80.28947, 76], [83.95, 20], [87.75, 4], [90, 43]], "mean": 38.58165}, "column_number": 0, "order": 0}, "000001": {"optype": "categorical", "name": "workclass", "datatype": "string", "preferred": true, "summary": {"missing_count": 1836, "categories": [["Private", 22696], ["Self-emp-not-inc", 2541], ["Local-gov", 2093], ["State-gov", 1298], ["Self-emp-inc", 1116], ["Federal-gov", 960], ["Without-pay", 14], ["Never-worked", 7]]}, "column_number": 1, "order": 1}, "000008": {"optype": "categorical", "name": "race", "datatype": "string", "preferred": true, "summary": {"missing_count": 0, "categories": [["White", 27816], ["Black", 3124], ["Asian-Pac-Islander", 1039], ["Amer-Indian-Eskimo", 311], ["Other", 271]]}, "column_number": 8, "order": 8}, "000009": {"optype": "categorical", "name": "sex", "datatype": "string", "preferred": true, "summary": {"missing_count": 0, "categories": [["Male", 21790], ["Female", 10771]]}, "column_number": 9, "order": 9}, "00000e": {"optype": "categorical", "name": "income", "datatype": "string", "preferred": true, "summary": {"missing_count": 0, "categories": [["<=50K", 24720], [">50K", 7841]]}, "column_number": 14, "order": 13}, "00000b": {"optype": "numeric", "name": "capital-loss", "datatype": "int16", "preferred": true, "summary": {"sum_squares": 5535171692, "splits": [3.83993], "missing_count": 0, "sum": 2842700, "median": 3.83993, "maximum": 4356, "minimum": 0, "standard_deviation": 402.96022, "variance": 162376.93781, "population": 32561, "bins": [[0, 31042], [155, 1], [213, 4], [323, 3], [419, 3], [630.6, 15], [810, 2], [880, 6], [974, 2], [1102.22222, 9], [1258, 4], [1340, 7], [1401.34483, 29], [1490.65714, 70], [1592.57059, 170], [1667.54795, 73], [1736.03125, 128], [1887.39083, 458], [1981.24706, 255], [2050.56757, 37], [2182.56818, 44], [2254.45, 40], [2340.36842, 19], [2411.77083, 96], [2567.19048, 21], [2754, 2], [2824, 10], [3004, 2], [3683, 2], [3770, 2], [3900, 2], [4356, 3]], "mean": 87.30383}, "column_number": 11, "order": 11}, "00000c": {"optype": "numeric", "name": "hours-per-week", "datatype": "int8", "preferred": true, "summary": {"sum_squares": 58207416, "splits": [14.47328, 19.73604, 23.54733, 28.33078, 30.47572, 34.89747, 36.67729, 39.22601, 39.42911, 39.5635, 39.67161, 39.76463, 39.84754, 39.92305, 39.99284, 40.06163, 40.1358, 40.21695, 40.30751, 40.4118, 40.53898, 40.71834, 43.5524, 44.94996, 45.87216, 49.50563, 49.98745, 50.44867, 55.03869, 59.86356, 64.6363], "missing_count": 0, "sum": 1316684, "median": 40.06163, "maximum": 99, "minimum": 1, "standard_deviation": 12.34743, "variance": 152.459, "population": 32561, "bins": [[1.61538, 52], [4.68664, 217], [7.84795, 171], [9.93919, 296], [12.33195, 241], [15.33662, 609], [17.72115, 104], [20.07504, 1306], [24.72979, 977], [27.74138, 116], [29.99394, 1156], [32.26627, 338], [35.14502, 1517], [37.7616, 625], [40.02811, 15510], [44.80961, 2269], [47.91343, 566], [50.0867, 2999], [55.007, 857], [57.62222, 45], [60.022, 1500], [64.94035, 285], [67.75, 16], [70.40659, 364], [74.98507, 67], [77.29412, 17], [80.0365, 137], [84.22414, 58], [86.33333, 3], [89.97297, 37], [95.8, 10], [98.88542, 96]], "mean": 40.43746}, "column_number": 12, "order": 12}, "00000a": {"optype": "numeric", "name": "capital-gain", "datatype": "int32", "preferred": true, "summary": {"sum_squares": 1813719045084, "splits": [5.30214], "missing_count": 0, "sum": 35089324, "median": 5.30214, "maximum": 99999, "minimum": 0, "standard_deviation": 7385.29208, "variance": 54542539.17841, "population": 32561, "bins": [[0.02291, 29855], [583.27778, 36], [1052.2963, 54], [1603.7037, 54], [2319.77922, 231], [3022.86667, 225], [3412.46763, 139], [3972.7218, 133], [4575.77419, 186], [5109.11976, 167], [5523.57895, 19], [6097, 1], [6459.96429, 28], [6829.52941, 34], [7305.35769, 260], [7691.17361, 288], [8614, 55], [9413.07692, 26], [10541.2459, 61], [11678, 2], [13550, 27], [14184.89552, 67], [15023.94318, 352], [15831, 6], [18481, 2], [20051, 37], [22040, 1], [25206.13333, 15], [27828, 34], [34095, 5], [41310, 2], [99999, 159]], "mean": 1077.64884}, "column_number": 10, "order": 10}}, "model_fields": {"000006": {"optype": "categorical", "name": "occupation", "datatype": "string", "preferred": true, "column_number": 6, "order": 6}, "000007": {"optype": "categorical", "name": "relationship", "datatype": "string", "preferred": true, "column_number": 7, "order": 7}, "000004": {"optype": "numeric", "name": "education-num", "datatype": "int8", "preferred": true, "column_number": 4, "order": 4}, "000005": {"optype": "categorical", "name": "marital-status", "datatype": "string", "preferred": true, "column_number": 5, "order": 5}, "000002": {"optype": "numeric", "name": "fnlwgt", "datatype": "int32", "preferred": true, "column_number": 2, "order": 2}, "000003": {"optype": "categorical", "name": "education", "datatype": "string", "preferred": true, "column_number": 3, "order": 3}, "000000": {"optype": "numeric", "name": "age", "datatype": "int8", "preferred": true, "column_number": 0, "order": 0}, "000001": {"optype": "categorical", "name": "workclass", "datatype": "string", "preferred": true, "column_number": 1, "order": 1}, "000008": {"optype": "categorical", "name": "race", "datatype": "string", "preferred": true, "column_number": 8, "order": 8}, "000009": {"optype": "categorical", "name": "sex", "datatype": "string", "preferred": true, "column_number": 9, "order": 9}, "00000e": {"optype": "categorical", "name": "income", "datatype": "string", "preferred": true, "column_number": 14, "order": 14}, "00000b": {"optype": "numeric", "name": "capital-loss", "datatype": "int16", "preferred": true, "column_number": 11, "order": 11}, "00000c": {"optype": "numeric", "name": "hours-per-week", "datatype": "int8", "preferred": true, "column_number": 12, "order": 12}, "00000a": {"optype": "numeric", "name": "capital-gain", "datatype": "int32", "preferred": true, "column_number": 10, "order": 10}}, "support_threshold": 0, "split_criterion": "Information gain mix", "root": {"count": 32561, "confidence": 0.75452, "predicate": true, "objective_summary": {"categories": [[">50K", 7841], ["<=50K", 24720]]}, "output": "<=50K", "children": [{"count": 17585, "confidence": 0.93091, "predicate": {"operator": "!=", "field": "000005", "value": "Married-civ-spouse"}, "objective_summary": {"categories": [[">50K", 1149], ["<=50K", 16436]]}, "output": "<=50K", "children": [{"count": 17275, "output": "<=50K", "confidence": 0.94747, "predicate": {"operator": "<=", "field": "00000a", "value": 7364}, "objective_summary": {"categories": [[">50K", 850], ["<=50K", 16425]]}}, {"count": 310, "confidence": 0.93759, "predicate": {"operator": ">", "field": "00000a", "value": 7364}, "objective_summary": {"categories": [["<=50K", 11], [">50K", 299]]}, "output": ">50K", "children": [{"count": 306, "confidence": 0.95354, "predicate": {"operator": ">", "field": "000000", "value": 20}, "objective_summary": {"categories": [["<=50K", 7], [">50K", 299]]}, "output": ">50K", "children": [{"count": 18, "confidence": 0.43749, "predicate": {"operator": "<=", "field": "00000a", "value": 8296}, "objective_summary": {"categories": [["<=50K", 6], [">50K", 12]]}, "output": ">50K", "children": [{"count": 10, "output": ">50K", "confidence": 0.72246, "predicate": {"operator": ">", "field": "000004", "value": 11}, "objective_summary": {"categories": [[">50K", 10]]}}, {"count": 8, "confidence": 0.40927, "predicate": {"operator": "<=", "field": "000004", "value": 11}, "objective_summary": {"categories": [[">50K", 2], ["<=50K", 6]]}, "output": "<=50K", "children": [{"count": 6, "output": "<=50K", "confidence": 0.60966, "predicate": {"operator": "=", "field": "000001", "value": "Private"}, "objective_summary": {"categories": [["<=50K", 6]]}}, {"count": 2, "output": ">50K", "confidence": 0.34237, "predicate": {"operator": "=", "field": "000001", "value": "Local-gov"}, "objective_summary": {"categories": [[">50K", 2]]}}]}]}, {"count": 288, "output": ">50K", "confidence": 0.9806, "predicate": {"operator": ">", "field": "00000a", "value": 8296}, "objective_summary": {"categories": [["<=50K", 1], [">50K", 287]]}}]}, {"count": 4, "output": "<=50K", "confidence": 0.5101, "predicate": {"operator": "<=", "field": "000000", "value": 20}, "objective_summary": {"categories": [["<=50K", 4]]}}]}]}, {"count": 14976, "confidence": 0.54518, "predicate": {"operator": "=", "field": "000005", "value": "Married-civ-spouse"}, "objective_summary": {"categories": [[">50K", 6692], ["<=50K", 8284]]}, "output": "<=50K", "children": [{"count": 10047, "confidence": 0.66711, "predicate": {"operator": "<=", "field": "000004", "value": 11}, "objective_summary": {"categories": [[">50K", 3252], ["<=50K", 6795]]}, "output": "<=50K", "children": [{"count": 494, "output": ">50K", "confidence": 0.96057, "predicate": {"operator": ">", "field": "00000a", "value": 5095}, "objective_summary": {"categories": [["<=50K", 11], [">50K", 483]]}}, {"count": 9553, "confidence": 0.70096, "predicate": {"operator": "<=", "field": "00000a", "value": 5095}, "objective_summary": {"categories": [[">50K", 2769], ["<=50K", 6784]]}, "output": "<=50K", "children": [{"count": 168, "output": "<=50K", "confidence": 0.88657, "predicate": {"operator": "=", "field": "000003", "value": "5th-6th"}, "objective_summary": {"categories": [[">50K", 11], ["<=50K", 157]]}}, {"count": 353, "confidence": 0.88127, "predicate": {"operator": "=", "field": "000003", "value": "7th-8th"}, "objective_summary": {"categories": [[">50K", 30], ["<=50K", 323]]}, "output": "<=50K", "children": [{"count": 312, "output": "<=50K", "confidence": 0.8881, "predicate": {"operator": "!=", "field": "000001", "value": "Self-emp-inc"}, "objective_summary": {"categories": [[">50K", 24], ["<=50K", 288]]}}, {"count": 11, "confidence": 0.28009, "predicate": {"operator": "=", "field": "000001", "value": "Self-emp-inc"}, "objective_summary": {"categories": [[">50K", 5], ["<=50K", 6]]}, "output": "<=50K", "children": [{"count": 3, "output": "<=50K", "confidence": 0.43849, "predicate": {"operator": "<=", "field": "000000", "value": 47}, "objective_summary": {"categories": [["<=50K", 3]]}}, {"count": 8, "confidence": 0.30574, "predicate": {"operator": ">", "field": "000000", "value": 47}, "objective_summary": {"categories": [["<=50K", 3], [">50K", 5]]}, "output": ">50K", "children": [{"count": 4, "confidence": 0.30064, "predicate": {"operator": "!=", "field": "000006", "value": "Craft-repair"}, "objective_summary": {"categories": [[">50K", 1], ["<=50K", 3]]}, "output": "<=50K", "children": [{"count": 1, "output": ">50K", "confidence": 0.20654, "predicate": {"operator": "=", "field": "000006", "value": "Machine-op-inspct"}, "objective_summary": {"categories": [[">50K", 1]]}}, {"count": 3, "output": "<=50K", "confidence": 0.43849, "predicate": {"operator": "!=", "field": "000006", "value": "Machine-op-inspct"}, "objective_summary": {"categories": [["<=50K", 3]]}}]}, {"count": 4, "output": ">50K", "confidence": 0.5101, "predicate": {"operator": "=", "field": "000006", "value": "Craft-repair"}, "objective_summary": {"categories": [[">50K", 4]]}}]}]}]}, {"count": 228, "output": "<=50K", "confidence": 0.87867, "predicate": {"operator": "=", "field": "000003", "value": "9th"}, "objective_summary": {"categories": [[">50K", 18], ["<=50K", 210]]}}, {"count": 80, "confidence": 0.8619, "predicate": {"operator": "=", "field": "000003", "value": "1st-4th"}, "objective_summary": {"categories": [[">50K", 5], ["<=50K", 75]]}, "output": "<=50K", "children": [{"count": 74, "confidence": 0.86909, "predicate": {"operator": "!=", "field": "000006", "value": "Exec-managerial"}, "objective_summary": {"categories": [[">50K", 4], ["<=50K", 70]]}, "output": "<=50K", "children": [{"count": 73, "output": "<=50K", "confidence": 0.886, "predicate": {"operator": "<=", "field": "000002", "value": 516423}, "objective_summary": {"categories": [[">50K", 3], ["<=50K", 70]]}}, {"count": 1, "output": ">50K", "confidence": 0.20654, "predicate": {"operator": ">", "field": "000002", "value": 516423}, "objective_summary": {"categories": [[">50K", 1]]}}]}, {"count": 1, "output": ">50K", "confidence": 0.20654, "predicate": {"operator": "=", "field": "000006", "value": "Exec-managerial"}, "objective_summary": {"categories": [[">50K", 1]]}}]}, {"count": 4635, "confidence": 0.70554, "predicate": {"operator": "=", "field": "000003", "value": "HS-grad"}, "objective_summary": {"categories": [[">50K", 1304], ["<=50K", 3331]]}, "output": "<=50K", "children": [{"count": 172, "confidence": 0.63746, "predicate": {"operator": ">", "field": "00000b", "value": 1782}, "objective_summary": {"categories": [["<=50K", 50], [">50K", 122]]}, "output": ">50K", "children": [{"count": 120, "output": ">50K", "confidence": 0.8952, "predicate": {"operator": "<=", "field": "00000b", "value": 1989}, "objective_summary": {"categories": [["<=50K", 6], [">50K", 114]]}}, {"count": 52, "output": "<=50K", "confidence": 0.72476, "predicate": {"operator": ">", "field": "00000b", "value": 1989}, "objective_summary": {"categories": [[">50K", 8], ["<=50K", 44]]}}]}, {"count": 4463, "output": "<=50K", "confidence": 0.72201, "predicate": {"operator": "<=", "field": "00000b", "value": 1782}, "objective_summary": {"categories": [[">50K", 1182], ["<=50K", 3281]]}}]}, {"count": 639, "confidence": 0.54354, "predicate": {"operator": "=", "field": "000003", "value": "Assoc-voc"}, "objective_summary": {"categories": [[">50K", 267], ["<=50K", 372]]}, "output": "<=50K", "children": [{"count": 436, "confidence": 0.4601, "predicate": {"operator": ">", "field": "000000", "value": 34}, "objective_summary": {"categories": [[">50K", 215], ["<=50K", 221]]}, "output": "<=50K", "children": [{"count": 413, "confidence": 0.47966, "predicate": {"operator": "<=", "field": "00000b", "value": 1794}, "objective_summary": {"categories": [[">50K", 195], ["<=50K", 218]]}, "output": "<=50K", "children": [{"count": 337, "output": "<=50K", "confidence": 0.5134, "predicate": {"operator": "!=", "field": "000006", "value": "Exec-managerial"}, "objective_summary": {"categories": [[">50K", 146], ["<=50K", 191]]}}, {"count": 60, "output": ">50K", "confidence": 0.54057, "predicate": {"operator": "=", "field": "000006", "value": "Exec-managerial"}, "objective_summary": {"categories": [["<=50K", 20], [">50K", 40]]}}]}, {"count": 23, "output": ">50K", "confidence": 0.67872, "predicate": {"operator": ">", "field": "00000b", "value": 1794}, "objective_summary": {"categories": [["<=50K", 3], [">50K", 20]]}}]}, {"count": 203, "confidence": 0.67965, "predicate": {"operator": "<=", "field": "000000", "value": 34}, "objective_summary": {"categories": [[">50K", 52], ["<=50K", 151]]}, "output": "<=50K", "children": [{"count": 23, "confidence": 0.79008, "predicate": {"operator": "<=", "field": "000000", "value": 24}, "objective_summary": {"categories": [[">50K", 1], ["<=50K", 22]]}, "output": "<=50K", "children": [{"count": 1, "output": ">50K", "confidence": 0.20654, "predicate": {"operator": ">", "field": "00000c", "value": 52}, "objective_summary": {"categories": [[">50K", 1]]}}, {"count": 22, "output": "<=50K", "confidence": 0.85134, "predicate": {"operator": "<=", "field": "00000c", "value": 52}, "objective_summary": {"categories": [["<=50K", 22]]}}]}, {"count": 180, "confidence": 0.64684, "predicate": {"operator": ">", "field": "000000", "value": 24}, "objective_summary": {"categories": [[">50K", 51], ["<=50K", 129]]}, "output": "<=50K", "children": [{"count": 172, "confidence": 0.66186, "predicate": {"operator": "!=", "field": "000001", "value": "Federal-gov"}, "objective_summary": {"categories": [[">50K", 46], ["<=50K", 126]]}, "output": "<=50K", "children": [{"count": 169, "output": "<=50K", "confidence": 0.67494, "predicate": {"operator": "<=", "field": "000002", "value": 497789}, "objective_summary": {"categories": [[">50K", 43], ["<=50K", 126]]}}, {"count": 3, "output": ">50K", "confidence": 0.43849, "predicate": {"operator": ">", "field": "000002", "value": 497789}, "objective_summary": {"categories": [[">50K", 3]]}}]}, {"count": 3, "output": ">50K", "confidence": 0.43849, "predicate": {"operator": "=", "field": "000001", "value": "Federal-gov"}, "objective_summary": {"categories": [[">50K", 3]]}}]}]}]}, {"count": 343, "output": "<=50K", "confidence": 0.81615, "predicate": {"operator": "=", "field": "000003", "value": "10th"}, "objective_summary": {"categories": [[">50K", 49], ["<=50K", 294]]}}, {"count": 342, "output": "<=50K", "confidence": 0.87089, "predicate": {"operator": "=", "field": "000003", "value": "11th"}, "objective_summary": {"categories": [[">50K", 32], ["<=50K", 310]]}}, {"count": 123, "output": "<=50K", "confidence": 0.74401, "predicate": {"operator": "=", "field": "000003", "value": "12th"}, "objective_summary": {"categories": [[">50K", 22], ["<=50K", 101]]}}, {"count": 19, "output": "<=50K", "confidence": 0.83182, "predicate": {"operator": "=", "field": "000003", "value": "Preschool"}, "objective_summary": {"categories": [["<=50K", 19]]}}, {"count": 2623, "confidence": 0.5881, "predicate": {"operator": "=", "field": "000003", "value": "Some-college"}, "objective_summary": {"categories": [[">50K", 1031], ["<=50K", 1592]]}, "output": "<=50K", "children": [{"count": 1928, "confidence": 0.52595, "predicate": {"operator": ">", "field": "000000", "value": 33}, "objective_summary": {"categories": [[">50K", 871], ["<=50K", 1057]]}, "output": "<=50K", "children": [{"count": 1836, "confidence": 0.5464, "predicate": {"operator": "<=", "field": "00000b", "value": 1846}, "objective_summary": {"categories": [[">50K", 791], ["<=50K", 1045]]}, "output": "<=50K", "children": [{"count": 1687, "output": "<=50K", "confidence": 0.52507, "predicate": {"operator": "!=", "field": "000006", "value": "Farming-fishing"}, "objective_summary": {"categories": [[">50K", 761], ["<=50K", 926]]}}, {"count": 77, "output": "<=50K", "confidence": 0.80815, "predicate": {"operator": "=", "field": "000006", "value": "Farming-fishing"}, "objective_summary": {"categories": [[">50K", 8], ["<=50K", 69]]}}]}, {"count": 92, "confidence": 0.78572, "predicate": {"operator": ">", "field": "00000b", "value": 1846}, "objective_summary": {"categories": [["<=50K", 12], [">50K", 80]]}, "output": ">50K", "children": [{"count": 22, "confidence": 0.34659, "predicate": {"operator": ">", "field": "00000b", "value": 2009}, "objective_summary": {"categories": [[">50K", 10], ["<=50K", 12]]}, "output": "<=50K", "children": [{"count": 11, "output": ">50K", "confidence": 0.43435, "predicate": {"operator": "<=", "field": "000002", "value": 168511}, "objective_summary": {"categories": [["<=50K", 3], [">50K", 8]]}}, {"count": 11, "output": "<=50K", "confidence": 0.52301, "predicate": {"operator": ">", "field": "000002", "value": 168511}, "objective_summary": {"categories": [[">50K", 2], ["<=50K", 9]]}}]}, {"count": 70, "output": ">50K", "confidence": 0.94798, "predicate": {"operator": "<=", "field": "00000b", "value": 2009}, "objective_summary": {"categories": [[">50K", 70]]}}]}]}, {"count": 695, "output": "<=50K", "confidence": 0.73705, "predicate": {"operator": "<=", "field": "000000", "value": 33}, "objective_summary": {"categories": [[">50K", 160], ["<=50K", 535]]}}]}]}]}, {"count": 4929, "confidence": 0.68494, "predicate": {"operator": ">", "field": "000004", "value": 11}, "objective_summary": {"categories": [["<=50K", 1489], [">50K", 3440]]}, "output": ">50K", "children": [{"count": 715, "output": ">50K", "confidence": 0.98774, "predicate": {"operator": ">", "field": "00000a", "value": 5095}, "objective_summary": {"categories": [["<=50K", 3], [">50K", 712]]}}, {"count": 4214, "confidence": 0.63281, "predicate": {"operator": "<=", "field": "00000a", "value": 5095}, "objective_summary": {"categories": [["<=50K", 1486], [">50K", 2728]]}, "output": ">50K", "children": [{"count": 2, "output": "<=50K", "confidence": 0.34237, "predicate": {"operator": "=", "field": "000006", "value": "Priv-house-serv"}, "objective_summary": {"categories": [["<=50K", 2]]}}, {"count": 32, "confidence": 0.57893, "predicate": {"operator": "=", "field": "000006", "value": "Handlers-cleaners"}, "objective_summary": {"categories": [[">50K", 8], ["<=50K", 24]]}, "output": "<=50K", "children": [{"count": 12, "output": "<=50K", "confidence": 0.7575, "predicate": {"operator": "!=", "field": "000003", "value": "Bachelors"}, "objective_summary": {"categories": [["<=50K", 12]]}}, {"count": 20, "confidence": 0.38658, "predicate": {"operator": "=", "field": "000003", "value": "Bachelors"}, "objective_summary": {"categories": [[">50K", 8], ["<=50K", 12]]}, "output": "<=50K", "children": [{"count": 17, "confidence": 0.46866, "predicate": {"operator": "<=", "field": "00000c", "value": 60}, "objective_summary": {"categories": [[">50K", 5], ["<=50K", 12]]}, "output": "<=50K", "children": [{"count": 2, "output": ">50K", "confidence": 0.34237, "predicate": {"operator": "!=", "field": "000007", "value": "Husband"}, "objective_summary": {"categories": [[">50K", 2]]}}, {"count": 15, "confidence": 0.54814, "predicate": {"operator": "=", "field": "000007", "value": "Husband"}, "objective_summary": {"categories": [[">50K", 3], ["<=50K", 12]]}, "output": "<=50K", "children": [{"count": 1, "output": ">50K", "confidence": 0.20654, "predicate": {"operator": "=", "field": "000008", "value": "Black"}, "objective_summary": {"categories": [[">50K", 1]]}}, {"count": 14, "output": "<=50K", "confidence": 0.60058, "predicate": {"operator": "!=", "field": "000008", "value": "Black"}, "objective_summary": {"categories": [[">50K", 2], ["<=50K", 12]]}}]}]}, {"count": 3, "output": ">50K", "confidence": 0.43849, "predicate": {"operator": ">", "field": "00000c", "value": 60}, "objective_summary": {"categories": [[">50K", 3]]}}]}]}, {"count": 1102, "output": ">50K", "confidence": 0.73811, "predicate": {"operator": "=", "field": "000006", "value": "Exec-managerial"}, "objective_summary": {"categories": [["<=50K", 260], [">50K", 842]]}}, {"count": 67, "confidence": 0.55258, "predicate": {"operator": "=", "field": "000006", "value": "Farming-fishing"}, "objective_summary": {"categories": [[">50K", 22], ["<=50K", 45]]}, "output": "<=50K", "children": [{"count": 62, "confidence": 0.60407, "predicate": {"operator": "!=", "field": "000001", "value": "Self-emp-inc"}, "objective_summary": {"categories": [[">50K", 17], ["<=50K", 45]]}, "output": "<=50K", "children": [{"count": 7, "confidence": 0.48687, "predicate": {"operator": "<=", "field": "000002", "value": 34586}, "objective_summary": {"categories": [["<=50K", 1], [">50K", 6]]}, "output": ">50K", "children": [{"count": 6, "output": ">50K", "confidence": 0.60966, "predicate": {"operator": "=", "field": "000003", "value": "Bachelors"}, "objective_summary": {"categories": [[">50K", 6]]}}, {"count": 1, "output": "<=50K", "confidence": 0.20654, "predicate": {"operator": "=", "field": "000003", "value": "Masters"}, "objective_summary": {"categories": [["<=50K", 1]]}}]}, {"count": 55, "output": "<=50K", "confidence": 0.67635, "predicate": {"operator": ">", "field": "000002", "value": 34586}, "objective_summary": {"categories": [[">50K", 11], ["<=50K", 44]]}}]}, {"count": 5, "output": ">50K", "confidence": 0.56551, "predicate": {"operator": "=", "field": "000001", "value": "Self-emp-inc"}, "objective_summary": {"categories": [[">50K", 5]]}}]}, {"count": 1462, "confidence": 0.6848, "predicate": {"operator": "=", "field": "000006", "value": "Prof-specialty"}, "objective_summary": {"categories": [["<=50K", 426], [">50K", 1036]]}, "output": ">50K", "children": [{"count": 172, "confidence": 0.91092, "predicate": {"operator": ">", "field": "00000b", "value": 1794}, "objective_summary": {"categories": [["<=50K", 8], [">50K", 164]]}, "output": ">50K", "children": [{"count": 142, "output": ">50K", "confidence": 0.96119, "predicate": {"operator": "<=", "field": "00000b", "value": 1989}, "objective_summary": {"categories": [["<=50K", 1], [">50K", 141]]}}, {"count": 30, "confidence": 0.59071, "predicate": {"operator": ">", "field": "00000b", "value": 1989}, "objective_summary": {"categories": [["<=50K", 7], [">50K", 23]]}, "output": ">50K", "children": [{"count": 24, "confidence": 0.79758, "predicate": {"operator": ">", "field": "00000b", "value": 2115}, "objective_summary": {"categories": [["<=50K", 1], [">50K", 23]]}, "output": ">50K", "children": [{"count": 23, "output": ">50K", "confidence": 0.85688, "predicate": {"operator": "=", "field": "000009", "value": "Male"}, "objective_summary": {"categories": [[">50K", 23]]}}, {"count": 1, "output": "<=50K", "confidence": 0.20654, "predicate": {"operator": "=", "field": "000009", "value": "Female"}, "objective_summary": {"categories": [["<=50K", 1]]}}]}, {"count": 6, "output": "<=50K", "confidence": 0.60966, "predicate": {"operator": "<=", "field": "00000b", "value": 2115}, "objective_summary": {"categories": [["<=50K", 6]]}}]}]}, {"count": 1290, "confidence": 0.64994, "predicate": {"operator": "<=", "field": "00000b", "value": 1794}, "objective_summary": {"categories": [["<=50K", 418], [">50K", 872]]}, "output": ">50K", "children": [{"count": 209, "confidence": 0.46823, "predicate": {"operator": "<=", "field": "000000", "value": 32}, "objective_summary": {"categories": [[">50K", 97], ["<=50K", 112]]}, "output": "<=50K", "children": [{"count": 164, "output": ">50K", "confidence": 0.44828, "predicate": {"operator": ">", "field": "000000", "value": 26}, "objective_summary": {"categories": [["<=50K", 78], [">50K", 86]]}}, {"count": 45, "output": "<=50K", "confidence": 0.61326, "predicate": {"operator": "<=", "field": "000000", "value": 26}, "objective_summary": {"categories": [[">50K", 11], ["<=50K", 34]]}}]}, {"count": 1081, "output": ">50K", "confidence": 0.68934, "predicate": {"operator": ">", "field": "000000", "value": 32}, "objective_summary": {"categories": [["<=50K", 306], [">50K", 775]]}}]}]}, {"count": 535, "confidence": 0.57683, "predicate": {"operator": "=", "field": "000006", "value": "Sales"}, "objective_summary": {"categories": [["<=50K", 204], [">50K", 331]]}, "output": ">50K", "children": [{"count": 49, "output": ">50K", "confidence": 0.89306, "predicate": {"operator": ">", "field": "00000b", "value": 1794}, "objective_summary": {"categories": [["<=50K", 1], [">50K", 48]]}}, {"count": 486, "confidence": 0.53798, "predicate": {"operator": "<=", "field": "00000b", "value": 1794}, "objective_summary": {"categories": [["<=50K", 203], [">50K", 283]]}, "output": ">50K", "children": [{"count": 48, "output": "<=50K", "confidence": 0.54667, "predicate": {"operator": "<=", "field": "00000c", "value": 36}, "objective_summary": {"categories": [[">50K", 15], ["<=50K", 33]]}}, {"count": 438, "confidence": 0.56545, "predicate": {"operator": ">", "field": "00000c", "value": 36}, "objective_summary": {"categories": [["<=50K", 170], [">50K", 268]]}, "output": ">50K", "children": [{"count": 393, "output": ">50K", "confidence": 0.58746, "predicate": {"operator": "!=", "field": "000003", "value": "Assoc-acdm"}, "objective_summary": {"categories": [["<=50K", 143], [">50K", 250]]}}, {"count": 45, "output": "<=50K", "confidence": 0.45452, "predicate": {"operator": "=", "field": "000003", "value": "Assoc-acdm"}, "objective_summary": {"categories": [[">50K", 18], ["<=50K", 27]]}}]}]}]}, {"count": 51, "output": "<=50K", "confidence": 0.54973, "predicate": {"operator": "=", "field": "000006", "value": "Transport-moving"}, "objective_summary": {"categories": [[">50K", 16], ["<=50K", 35]]}}, {"count": 68, "output": "<=50K", "confidence": 0.63561, "predicate": {"operator": "=", "field": "000006", "value": "Other-service"}, "objective_summary": {"categories": [[">50K", 17], ["<=50K", 51]]}}, {"count": 143, "confidence": 0.56204, "predicate": {"operator": "=", "field": "000006", "value": "Tech-support"}, "objective_summary": {"categories": [["<=50K", 51], [">50K", 92]]}, "output": ">50K", "children": [{"count": 139, "confidence": 0.57981, "predicate": {"operator": ">", "field": "000000", "value": 26}, "objective_summary": {"categories": [["<=50K", 47], [">50K", 92]]}, "output": ">50K", "children": [{"count": 36, "confidence": 0.34474, "predicate": {"operator": "=", "field": "000003", "value": "Assoc-acdm"}, "objective_summary": {"categories": [[">50K", 18], ["<=50K", 18]]}, "output": "<=50K", "children": [{"count": 33, "confidence": 0.37986, "predicate": {"operator": "=", "field": "000009", "value": "Male"}, "objective_summary": {"categories": [["<=50K", 15], [">50K", 18]]}, "output": ">50K", "children": [{"count": 30, "output": ">50K", "confidence": 0.4232, "predicate": {"operator": "=", "field": "000008", "value": "White"}, "objective_summary": {"categories": [["<=50K", 12], [">50K", 18]]}}, {"count": 3, "output": "<=50K", "confidence": 0.43849, "predicate": {"operator": "!=", "field": "000008", "value": "White"}, "objective_summary": {"categories": [["<=50K", 3]]}}]}, {"count": 3, "output": "<=50K", "confidence": 0.43849, "predicate": {"operator": "=", "field": "000009", "value": "Female"}, "objective_summary": {"categories": [["<=50K", 3]]}}]}, {"count": 103, "confidence": 0.62495, "predicate": {"operator": "!=", "field": "000003", "value": "Assoc-acdm"}, "objective_summary": {"categories": [["<=50K", 29], [">50K", 74]]}, "output": ">50K", "children": [{"count": 3, "output": "<=50K", "confidence": 0.43849, "predicate": {"operator": ">", "field": "000000", "value": 58}, "objective_summary": {"categories": [["<=50K", 3]]}}, {"count": 100, "output": ">50K", "confidence": 0.64629, "predicate": {"operator": "<=", "field": "000000", "value": 58}, "objective_summary": {"categories": [["<=50K", 26], [">50K", 74]]}}]}]}, {"count": 4, "output": "<=50K", "confidence": 0.5101, "predicate": {"operator": "<=", "field": "000000", "value": 26}, "objective_summary": {"categories": [["<=50K", 4]]}}]}, {"count": 58, "confidence": 0.49203, "predicate": {"operator": "=", "field": "000006", "value": "Machine-op-inspct"}, "objective_summary": {"categories": [[">50K", 22], ["<=50K", 36]]}, "output": "<=50K", "children": [{"count": 4, "output": ">50K", "confidence": 0.5101, "predicate": {"operator": ">", "field": "00000b", "value": 1867}, "objective_summary": {"categories": [[">50K", 4]]}}, {"count": 54, "output": "<=50K", "confidence": 0.53361, "predicate": {"operator": "<=", "field": "00000b", "value": 1867}, "objective_summary": {"categories": [[">50K", 18], ["<=50K", 36]]}}]}, {"count": 1, "output": ">50K", "confidence": 0.20654, "predicate": {"operator": "=", "field": "000006", "value": "Armed-Forces"}, "objective_summary": {"categories": [[">50K", 1]]}}, {"count": 85, "confidence": 0.52918, "predicate": {"operator": "=", "field": "000006", "value": "Protective-serv"}, "objective_summary": {"categories": [["<=50K", 31], [">50K", 54]]}, "output": ">50K", "children": [{"count": 36, "confidence": 0.64972, "predicate": {"operator": ">", "field": "000000", "value": 42}, "objective_summary": {"categories": [["<=50K", 7], [">50K", 29]]}, "output": ">50K", "children": [{"count": 4, "confidence": 0.30064, "predicate": {"operator": "<=", "field": "00000c", "value": 32}, "objective_summary": {"categories": [[">50K", 1], ["<=50K", 3]]}, "output": "<=50K", "children": [{"count": 3, "output": "<=50K", "confidence": 0.43849, "predicate": {"operator": "!=", "field": "000003", "value": "Masters"}, "objective_summary": {"categories": [["<=50K", 3]]}}, {"count": 1, "output": ">50K", "confidence": 0.20654, "predicate": {"operator": "=", "field": "000003", "value": "Masters"}, "objective_summary": {"categories": [[">50K", 1]]}}]}, {"count": 32, "output": ">50K", "confidence": 0.71931, "predicate": {"operator": ">", "field": "00000c", "value": 32}, "objective_summary": {"categories": [["<=50K", 4], [">50K", 28]]}}]}, {"count": 49, "confidence": 0.37467, "predicate": {"operator": "<=", "field": "000000", "value": 42}, "objective_summary": {"categories": [["<=50K", 24], [">50K", 25]]}, "output": ">50K", "children": [{"count": 28, "output": ">50K", "confidence": 0.4583, "predicate": {"operator": "=", "field": "000001", "value": "Local-gov"}, "objective_summary": {"categories": [["<=50K", 10], [">50K", 18]]}}, {"count": 21, "confidence": 0.45373, "predicate": {"operator": "!=", "field": "000001", "value": "Local-gov"}, "objective_summary": {"categories": [[">50K", 7], ["<=50K", 14]]}, "output": "<=50K", "children": [{"count": 7, "output": "<=50K", "confidence": 0.64566, "predicate": {"operator": "!=", "field": "000003", "value": "Bachelors"}, "objective_summary": {"categories": [["<=50K", 7]]}}, {"count": 14, "confidence": 0.26799, "predicate": {"operator": "=", "field": "000003", "value": "Bachelors"}, "objective_summary": {"categories": [[">50K", 7], ["<=50K", 7]]}, "output": "<=50K", "children": [{"count": 4, "output": "<=50K", "confidence": 0.5101, "predicate": {"operator": "=", "field": "000008", "value": "Black"}, "objective_summary": {"categories": [["<=50K", 4]]}}, {"count": 10, "output": ">50K", "confidence": 0.39677, "predicate": {"operator": "=", "field": "000008", "value": "White"}, "objective_summary": {"categories": [["<=50K", 3], [">50K", 7]]}}]}]}]}]}, {"count": 220, "confidence": 0.47041, "predicate": {"operator": "=", "field": "000006", "value": "Craft-repair"}, "objective_summary": {"categories": [[">50K", 102], ["<=50K", 118]]}, "output": "<=50K", "children": [{"count": 12, "confidence": 0.64611, "predicate": {"operator": ">", "field": "00000b", "value": 1794}, "objective_summary": {"categories": [["<=50K", 1], [">50K", 11]]}, "output": ">50K", "children": [{"count": 1, "output": "<=50K", "confidence": 0.20654, "predicate": {"operator": "=", "field": "000001", "value": "Self-emp-inc"}, "objective_summary": {"categories": [["<=50K", 1]]}}, {"count": 11, "output": ">50K", "confidence": 0.74116, "predicate": {"operator": "!=", "field": "000001", "value": "Self-emp-inc"}, "objective_summary": {"categories": [[">50K", 11]]}}]}, {"count": 208, "confidence": 0.49455, "predicate": {"operator": "<=", "field": "00000b", "value": 1794}, "objective_summary": {"categories": [[">50K", 91], ["<=50K", 117]]}, "output": "<=50K", "children": [{"count": 139, "confidence": 0.42151, "predicate": {"operator": "=", "field": "000001", "value": "Private"}, "objective_summary": {"categories": [[">50K", 69], ["<=50K", 70]]}, "output": "<=50K", "children": [{"count": 98, "confidence": 0.46251, "predicate": {"operator": "!=", "field": "000003", "value": "Assoc-acdm"}, "objective_summary": {"categories": [["<=50K", 43], [">50K", 55]]}, "output": ">50K", "children": [{"count": 3, "output": "<=50K", "confidence": 0.43849, "predicate": {"operator": "=", "field": "000007", "value": "Other-relative"}, "objective_summary": {"categories": [["<=50K", 3]]}}, {"count": 95, "output": ">50K", "confidence": 0.47849, "predicate": {"operator": "!=", "field": "000007", "value": "Other-relative"}, "objective_summary": {"categories": [["<=50K", 40], [">50K", 55]]}}]}, {"count": 41, "output": "<=50K", "confidence": 0.5055, "predicate": {"operator": "=", "field": "000003", "value": "Assoc-acdm"}, "objective_summary": {"categories": [[">50K", 14], ["<=50K", 27]]}}]}, {"count": 69, "output": "<=50K", "confidence": 0.56416, "predicate": {"operator": "!=", "field": "000001", "value": "Private"}, "objective_summary": {"categories": [[">50K", 22], ["<=50K", 47]]}}]}]}, {"count": 241, "confidence": 0.45579, "predicate": {"operator": "=", "field": "000006", "value": "Adm-clerical"}, "objective_summary": {"categories": [["<=50K", 116], [">50K", 125]]}, "output": ">50K", "children": [{"count": 12, "output": ">50K", "confidence": 0.7575, "predicate": {"operator": ">", "field": "00000b", "value": 1794}, "objective_summary": {"categories": [[">50K", 12]]}}, {"count": 229, "confidence": 0.44222, "predicate": {"operator": "<=", "field": "00000b", "value": 1794}, "objective_summary": {"categories": [[">50K", 113], ["<=50K", 116]]}, "output": "<=50K", "children": [{"count": 25, "confidence": 0.60869, "predicate": {"operator": "<=", "field": "00000c", "value": 32}, "objective_summary": {"categories": [[">50K", 5], ["<=50K", 20]]}, "output": "<=50K", "children": [{"count": 13, "output": "<=50K", "confidence": 0.7719, "predicate": {"operator": "!=", "field": "000007", "value": "Wife"}, "objective_summary": {"categories": [["<=50K", 13]]}}, {"count": 12, "confidence": 0.31951, "predicate": {"operator": "=", "field": "000007", "value": "Wife"}, "objective_summary": {"categories": [[">50K", 5], ["<=50K", 7]]}, "output": "<=50K", "children": [{"count": 7, "output": ">50K", "confidence": 0.35893, "predicate": {"operator": "<=", "field": "000002", "value": 264159}, "objective_summary": {"categories": [["<=50K", 2], [">50K", 5]]}}, {"count": 5, "output": "<=50K", "confidence": 0.56551, "predicate": {"operator": ">", "field": "000002", "value": 264159}, "objective_summary": {"categories": [["<=50K", 5]]}}]}]}, {"count": 204, "confidence": 0.46101, "predicate": {"operator": ">", "field": "00000c", "value": 32}, "objective_summary": {"categories": [["<=50K", 96], [">50K", 108]]}, "output": ">50K", "children": [{"count": 102, "confidence": 0.5306, "predicate": {"operator": ">", "field": "000000", "value": 40}, "objective_summary": {"categories": [["<=50K", 38], [">50K", 64]]}, "output": ">50K", "children": [{"count": 98, "output": ">50K", "confidence": 0.55466, "predicate": {"operator": "<=", "field": "00000a", "value": 3283}, "objective_summary": {"categories": [["<=50K", 34], [">50K", 64]]}}, {"count": 4, "output": "<=50K", "confidence": 0.5101, "predicate": {"operator": ">", "field": "00000a", "value": 3283}, "objective_summary": {"categories": [["<=50K", 4]]}}]}, {"count": 102, "confidence": 0.47175, "predicate": {"operator": "<=", "field": "000000", "value": 40}, "objective_summary": {"categories": [[">50K", 44], ["<=50K", 58]]}, "output": "<=50K", "children": [{"count": 97, "output": "<=50K", "confidence": 0.48815, "predicate": {"operator": "<=", "field": "000002", "value": 370433}, "objective_summary": {"categories": [[">50K", 40], ["<=50K", 57]]}}, {"count": 5, "output": ">50K", "confidence": 0.37553, "predicate": {"operator": ">", "field": "000002", "value": 370433}, "objective_summary": {"categories": [["<=50K", 1], [">50K", 4]]}}]}]}]}]}]}]}]}]}, "depth_threshold": 20}, "replacement": false}
<!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 + 10) + ")");
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("adult-model.json", function(error, root) {
var model = root.model;
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");
}
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) { return hover_adjust(d, scale_pred(d.output)); },
"confidence": function(d) { return hover_adjust(d, scale_conf(d.confidence)); },
"split": function(d) { return hover_adjust(d, scale_split(d.predicate.field)); } };
var color_fn = color_lookup["prediction"];
var path = svg.selectAll("path")
.data(partition.nodes(root.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 = split.field ? model.model_fields[split.field].name + " " +
split.operator + " " + split.value
: "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;
var msg = name;
fs = summaries[id];
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;
}
msg = msg;
}
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 (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 {
summary[pred.field] = {"max": pred.value};
}
break;
case ">":
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment