Skip to content

Instantly share code, notes, and snippets.

@mmerce
Last active Aug 29, 2015
Embed
What would you like to do?
BigMLer report subcommand: ROC curve and metrics graph for bigmler analyze --nodes
[{"name": "node_th3", "random": {"average_phi": 0.042179999999999995, "average_f_measure_standard_deviation": 0.04689196969868319, "average_recall_standard_deviation": 0.051233351116891326, "average_recall": 0.52144, "per_class_statistics": [{"accuracy_standard_deviation": 0.04618516649744616, "present_in_test_data": true, "f_measure_standard_deviation": 0.04491857553323388, "recall_standard_deviation": 0.057101277751135576, "average_recall": 0.5215811965811966, "precision_standard_deviation": 0.05944646441663742, "average_f_measure": 0.5632478632478632, "average_accuracy": 0.5202774008744158, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.04217803637266655, "phi_coefficient_standard_deviation": 0.10054332083322086, "average_precision": 0.6174145299145298}, {"accuracy_standard_deviation": 0.04618516649744616, "present_in_test_data": true, "f_measure_standard_deviation": 0.058774582088199696, "recall_standard_deviation": 0.09618140027279959, "average_recall": 0.5212996879663546, "precision_standard_deviation": 0.04127153707002976, "average_f_measure": 0.4654377880184333, "average_accuracy": 0.5202774008744158, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.04217803637266655, "phi_coefficient_standard_deviation": 0.10054332083322086, "average_precision": 0.42407407407407405}], "average_f_measure": 0.5143433333333333, "average_accuracy": 0.52028, "accuracy_standard_deviation": 0.04618473990399862, "average_phi_standard_deviation": 0.1005402300905795, "average_precision_standard_deviation": 0.04932755033672586, "average_precision": 0.5207433333333333, "confusion_matrix": [[62, 57], [39, 42]]}, "mode": {"average_phi": 0.0, "average_f_measure_standard_deviation": 0.003894477571582021, "average_recall_standard_deviation": 0.0, "average_recall": 0.5, "per_class_statistics": [{"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0077841129823569884, "recall_standard_deviation": 0.0, "average_recall": 1.0, "precision_standard_deviation": 0.009883783146741298, "average_f_measure": 0.7460765297125727, "average_accuracy": 0.5950550278908487, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.5950550278908487}, {"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0, "recall_standard_deviation": 0.0, "average_recall": 0.0, "precision_standard_deviation": 0.0, "average_f_measure": 0.0, "average_accuracy": 0.5950550278908487, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.0}], "average_f_measure": 0.3730366666666667, "average_accuracy": 0.5950533333333333, "accuracy_standard_deviation": 0.009883037095054467, "average_phi_standard_deviation": 0.0, "average_precision_standard_deviation": 0.004944035688472412, "average_precision": 0.29752666666666666, "confusion_matrix": [[119, 0], [81, 0]]}, "model": {"average_phi": 0.18617666666666666, "average_f_measure_standard_deviation": 0.0785063693098988, "average_recall_standard_deviation": 0.0662728915587328, "average_recall": 0.5851833333333334, "per_class_statistics": [{"accuracy_standard_deviation": 0.07270417982349249, "present_in_test_data": true, "f_measure_standard_deviation": 0.12504310914459876, "recall_standard_deviation": 0.23402089456435762, "average_recall": 0.6326923076923077, "precision_standard_deviation": 0.07523794253455235, "average_f_measure": 0.6269170750737572, "average_accuracy": 0.5903814262023217, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.18617854830362712, "phi_coefficient_standard_deviation": 0.12117647073686266, "average_precision": 0.6759277092963534}, {"accuracy_standard_deviation": 0.07270417982349249, "present_in_test_data": true, "f_measure_standard_deviation": 0.14909420153978034, "recall_standard_deviation": 0.2541694233496445, "average_recall": 0.537681454348121, "precision_standard_deviation": 0.08443147750684585, "average_f_measure": 0.47962962962962963, "average_accuracy": 0.5903814262023217, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.18617854830362712, "phi_coefficient_standard_deviation": 0.12117647073686266, "average_precision": 0.5353485838779957}], "average_f_measure": 0.5532766666666667, "average_accuracy": 0.5903833333333334, "accuracy_standard_deviation": 0.07270411099487811, "average_phi_standard_deviation": 0.12117589896051477, "average_precision_standard_deviation": 0.058078240522782876, "average_precision": 0.6056366666666667, "confusion_matrix": [[75, 44], [38, 43]]}, "nodes": "3", "class_names": ["true", "false"]}, {"name": "node_th18", "random": {"average_phi": 0.048036666666666665, "average_f_measure_standard_deviation": 0.030934160549284145, "average_recall_standard_deviation": 0.03178102298891938, "average_recall": 0.5240366666666667, "per_class_statistics": [{"accuracy_standard_deviation": 0.031874706403554595, "present_in_test_data": true, "f_measure_standard_deviation": 0.03835648295301695, "recall_standard_deviation": 0.06054742720902323, "average_recall": 0.4797008547008547, "precision_standard_deviation": 0.03363267964818312, "average_f_measure": 0.5389112408969645, "average_accuracy": 0.5147746117895371, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.04803466806605263, "phi_coefficient_standard_deviation": 0.06325581085857539, "average_precision": 0.6213282247765006}, {"accuracy_standard_deviation": 0.031874706403554595, "present_in_test_data": true, "f_measure_standard_deviation": 0.03868466167397293, "recall_standard_deviation": 0.07125355555783361, "average_recall": 0.5683760683760684, "precision_standard_deviation": 0.03414926999407667, "average_f_measure": 0.4854447161555686, "average_accuracy": 0.5147746117895371, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.04803466806605263, "phi_coefficient_standard_deviation": 0.06325581085857539, "average_precision": 0.4266637605347283}], "average_f_measure": 0.5121766666666666, "average_accuracy": 0.5147733333333333, "accuracy_standard_deviation": 0.03187165965068162, "average_phi_standard_deviation": 0.06325607709057596, "average_precision_standard_deviation": 0.03147720056732421, "average_precision": 0.5239933333333334, "confusion_matrix": [[57, 62], [35, 46]]}, "mode": {"average_phi": 0.0, "average_f_measure_standard_deviation": 0.003894477571582021, "average_recall_standard_deviation": 0.0, "average_recall": 0.5, "per_class_statistics": [{"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0077841129823569884, "recall_standard_deviation": 0.0, "average_recall": 1.0, "precision_standard_deviation": 0.009883783146741298, "average_f_measure": 0.7460765297125727, "average_accuracy": 0.5950550278908487, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.5950550278908487}, {"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0, "recall_standard_deviation": 0.0, "average_recall": 0.0, "precision_standard_deviation": 0.0, "average_f_measure": 0.0, "average_accuracy": 0.5950550278908487, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.0}], "average_f_measure": 0.3730366666666667, "average_accuracy": 0.5950533333333333, "accuracy_standard_deviation": 0.009883037095054467, "average_phi_standard_deviation": 0.0, "average_precision_standard_deviation": 0.004944035688472412, "average_precision": 0.29752666666666666, "confusion_matrix": [[119, 0], [81, 0]]}, "model": {"average_phi": 0.3042433333333333, "average_f_measure_standard_deviation": 0.05698370839303303, "average_recall_standard_deviation": 0.05875094911762892, "average_recall": 0.6515566666666668, "per_class_statistics": [{"accuracy_standard_deviation": 0.054036113301872156, "present_in_test_data": true, "f_measure_standard_deviation": 0.05802961797477611, "recall_standard_deviation": 0.10080942051764487, "average_recall": 0.6816239316239316, "precision_standard_deviation": 0.06860013399615537, "average_f_measure": 0.6991350997246837, "average_accuracy": 0.655359565807327, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.3042463168283873, "phi_coefficient_standard_deviation": 0.10984322220546443, "average_precision": 0.7309270997348836}, {"accuracy_standard_deviation": 0.054036113301872156, "present_in_test_data": true, "f_measure_standard_deviation": 0.07820816554423553, "recall_standard_deviation": 0.14269529460312924, "average_recall": 0.6214896214896215, "precision_standard_deviation": 0.05400617248673217, "average_f_measure": 0.5870279146141215, "average_accuracy": 0.655359565807327, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.3042463168283873, "phi_coefficient_standard_deviation": 0.10984322220546443, "average_precision": 0.575}], "average_f_measure": 0.6430833333333333, "average_accuracy": 0.6553566666666666, "accuracy_standard_deviation": 0.0540367636172099, "average_phi_standard_deviation": 0.1098430220309369, "average_precision_standard_deviation": 0.051433041476812894, "average_precision": 0.6529633333333333, "confusion_matrix": [[81, 38], [31, 50]]}, "nodes": "18", "class_names": ["true", "false"]}, {"name": "node_th13", "random": {"average_phi": -0.07276999999999999, "average_f_measure_standard_deviation": 0.05067734821616283, "average_recall_standard_deviation": 0.040818418228376604, "average_recall": 0.46445000000000003, "per_class_statistics": [{"accuracy_standard_deviation": 0.05535672458924841, "present_in_test_data": true, "f_measure_standard_deviation": 0.10497708072706219, "recall_standard_deviation": 0.1263122369811867, "average_recall": 0.4606837606837607, "precision_standard_deviation": 0.06576329708101283, "average_f_measure": 0.49741876057665535, "average_accuracy": 0.4652495100256294, "class_name": "false", "occurrences": 3, "average_phi_coefficient": -0.07276654407266603, "phi_coefficient_standard_deviation": 0.08398685256974381, "average_precision": 0.5494639376218324}, {"accuracy_standard_deviation": 0.05535672458924841, "present_in_test_data": true, "f_measure_standard_deviation": 0.015608878769600302, "recall_standard_deviation": 0.052593703609587227, "average_recall": 0.46822005155338486, "precision_standard_deviation": 0.021014029630670634, "average_f_measure": 0.414654594232059, "average_accuracy": 0.4652495100256294, "class_name": "true", "occurrences": 3, "average_phi_coefficient": -0.07276654407266603, "phi_coefficient_standard_deviation": 0.08398685256974381, "average_precision": 0.3760491847099706}], "average_f_measure": 0.45603666666666665, "average_accuracy": 0.46524999999999994, "accuracy_standard_deviation": 0.05535657202777883, "average_phi_standard_deviation": 0.08398667394295359, "average_precision_standard_deviation": 0.04320843204746037, "average_precision": 0.46276, "confusion_matrix": [[55, 64], [43, 38]]}, "mode": {"average_phi": 0.0, "average_f_measure_standard_deviation": 0.003894477571582021, "average_recall_standard_deviation": 0.0, "average_recall": 0.5, "per_class_statistics": [{"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0077841129823569884, "recall_standard_deviation": 0.0, "average_recall": 1.0, "precision_standard_deviation": 0.009883783146741298, "average_f_measure": 0.7460765297125727, "average_accuracy": 0.5950550278908487, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.5950550278908487}, {"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0, "recall_standard_deviation": 0.0, "average_recall": 0.0, "precision_standard_deviation": 0.0, "average_f_measure": 0.0, "average_accuracy": 0.5950550278908487, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.0}], "average_f_measure": 0.3730366666666667, "average_accuracy": 0.5950533333333333, "accuracy_standard_deviation": 0.009883037095054467, "average_phi_standard_deviation": 0.0, "average_precision_standard_deviation": 0.004944035688472412, "average_precision": 0.29752666666666666, "confusion_matrix": [[119, 0], [81, 0]]}, "model": {"average_phi": 0.37793333333333334, "average_f_measure_standard_deviation": 0.0569716578659951, "average_recall_standard_deviation": 0.05522935873850672, "average_recall": 0.68601, "per_class_statistics": [{"accuracy_standard_deviation": 0.05433717876361237, "present_in_test_data": true, "f_measure_standard_deviation": 0.04820303144608818, "recall_standard_deviation": 0.07151387317536188, "average_recall": 0.7647435897435898, "precision_standard_deviation": 0.054497753168103916, "average_f_measure": 0.7511876075731496, "average_accuracy": 0.7003618272274988, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.37793492072156576, "phi_coefficient_standard_deviation": 0.11089049370073091, "average_precision": 0.7429309708379476}, {"accuracy_standard_deviation": 0.05433717876361237, "present_in_test_data": true, "f_measure_standard_deviation": 0.07311120338145877, "recall_standard_deviation": 0.10313955442403572, "average_recall": 0.6072785239451907, "precision_standard_deviation": 0.069212320966168, "average_f_measure": 0.6193151158768592, "average_accuracy": 0.7003618272274988, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.37793492072156576, "phi_coefficient_standard_deviation": 0.11089049370073091, "average_precision": 0.6412631752305665}], "average_f_measure": 0.6852499999999999, "average_accuracy": 0.7003633333333333, "accuracy_standard_deviation": 0.05433852490534585, "average_phi_standard_deviation": 0.11088939304049276, "average_precision_standard_deviation": 0.05597586464023779, "average_precision": 0.6920966666666666, "confusion_matrix": [[91, 28], [32, 49]]}, "nodes": "13", "class_names": ["true", "false"]}, {"name": "node_th38", "random": {"average_phi": -0.04358000000000001, "average_f_measure_standard_deviation": 0.018573510408344714, "average_recall_standard_deviation": 0.02186726777629068, "average_recall": 0.47794000000000003, "per_class_statistics": [{"accuracy_standard_deviation": 0.012654975891110079, "present_in_test_data": true, "f_measure_standard_deviation": 0.009891910242449575, "recall_standard_deviation": 0.027301973639803665, "average_recall": 0.4871794871794872, "precision_standard_deviation": 0.017150387566575158, "average_f_measure": 0.5268416768416769, "average_accuracy": 0.48002412181516657, "class_name": "false", "occurrences": 3, "average_phi_coefficient": -0.04357994263714952, "phi_coefficient_standard_deviation": 0.04334353827146185, "average_precision": 0.5756755800792304}, {"accuracy_standard_deviation": 0.012654975891110079, "present_in_test_data": true, "f_measure_standard_deviation": 0.04656594282024388, "recall_standard_deviation": 0.07103830064225326, "average_recall": 0.468694885361552, "precision_standard_deviation": 0.02933794945480529, "average_f_measure": 0.4197420634920635, "average_accuracy": 0.48002412181516657, "class_name": "true", "occurrences": 3, "average_phi_coefficient": -0.04357994263714952, "phi_coefficient_standard_deviation": 0.04334353827146185, "average_precision": 0.38128239801667796}], "average_f_measure": 0.47329333333333334, "average_accuracy": 0.4800266666666666, "accuracy_standard_deviation": 0.012654486248845591, "average_phi_standard_deviation": 0.043343124022156045, "average_precision_standard_deviation": 0.021477738862987095, "average_precision": 0.47848, "confusion_matrix": [[58, 61], [43, 38]]}, "mode": {"average_phi": 0.0, "average_f_measure_standard_deviation": 0.003894477571582021, "average_recall_standard_deviation": 0.0, "average_recall": 0.5, "per_class_statistics": [{"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0077841129823569884, "recall_standard_deviation": 0.0, "average_recall": 1.0, "precision_standard_deviation": 0.009883783146741298, "average_f_measure": 0.7460765297125727, "average_accuracy": 0.5950550278908487, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.5950550278908487}, {"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0, "recall_standard_deviation": 0.0, "average_recall": 0.0, "precision_standard_deviation": 0.0, "average_f_measure": 0.0, "average_accuracy": 0.5950550278908487, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.0}], "average_f_measure": 0.3730366666666667, "average_accuracy": 0.5950533333333333, "accuracy_standard_deviation": 0.009883037095054467, "average_phi_standard_deviation": 0.0, "average_precision_standard_deviation": 0.004944035688472412, "average_precision": 0.29752666666666666, "confusion_matrix": [[119, 0], [81, 0]]}, "model": {"average_phi": 0.3490566666666667, "average_f_measure_standard_deviation": 0.04805183520602171, "average_recall_standard_deviation": 0.04793667512690279, "average_recall": 0.6709233333333334, "per_class_statistics": [{"accuracy_standard_deviation": 0.04718529041337307, "present_in_test_data": true, "f_measure_standard_deviation": 0.044860052112581636, "recall_standard_deviation": 0.08170555725319113, "average_recall": 0.7478632478632479, "precision_standard_deviation": 0.05470784738352568, "average_f_measure": 0.7370413159487263, "average_accuracy": 0.6852856927483792, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.3490538834867122, "phi_coefficient_standard_deviation": 0.0977437559929964, "average_precision": 0.734175084175084}, {"accuracy_standard_deviation": 0.04718529041337307, "present_in_test_data": true, "f_measure_standard_deviation": 0.06507390009993891, "recall_standard_deviation": 0.11350515607124893, "average_recall": 0.5939831773165106, "precision_standard_deviation": 0.06552344549934082, "average_f_measure": 0.6012798329423619, "average_accuracy": 0.6852856927483792, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.3490538834867122, "phi_coefficient_standard_deviation": 0.0977437559929964, "average_precision": 0.6225794665692364}], "average_f_measure": 0.66916, "average_accuracy": 0.6852866666666667, "accuracy_standard_deviation": 0.04718181735466414, "average_phi_standard_deviation": 0.09774258789744053, "average_precision_standard_deviation": 0.050586186739948, "average_precision": 0.6783766666666666, "confusion_matrix": [[89, 30], [33, 48]]}, "nodes": "38", "class_names": ["true", "false"]}, {"name": "node_th28", "random": {"average_phi": 0.09264000000000001, "average_f_measure_standard_deviation": 0.07289207958802289, "average_recall_standard_deviation": 0.07513658067516488, "average_recall": 0.5473566666666666, "per_class_statistics": [{"accuracy_standard_deviation": 0.07168436403360144, "present_in_test_data": true, "f_measure_standard_deviation": 0.06874904960898234, "recall_standard_deviation": 0.0670463655707062, "average_recall": 0.5623931623931624, "precision_standard_deviation": 0.07402587543733342, "average_f_measure": 0.5975490550138438, "average_accuracy": 0.5505050505050505, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.09263965545602759, "phi_coefficient_standard_deviation": 0.14723683719624128, "average_precision": 0.6385181704260652}, {"accuracy_standard_deviation": 0.07168436403360144, "present_in_test_data": true, "f_measure_standard_deviation": 0.08358864623048999, "recall_standard_deviation": 0.10063677759120886, "average_recall": 0.532322615655949, "precision_standard_deviation": 0.07100031045887326, "average_f_measure": 0.4885129490392648, "average_accuracy": 0.5505050505050505, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.09263965545602759, "phi_coefficient_standard_deviation": 0.14723683719624128, "average_precision": 0.4520896233910694}], "average_f_measure": 0.54303, "average_accuracy": 0.5505066666666667, "accuracy_standard_deviation": 0.071686454942494, "average_phi_standard_deviation": 0.1472383131751606, "average_precision_standard_deviation": 0.07212976932045617, "average_precision": 0.5453033333333333, "confusion_matrix": [[67, 52], [38, 43]]}, "mode": {"average_phi": 0.0, "average_f_measure_standard_deviation": 0.003894477571582021, "average_recall_standard_deviation": 0.0, "average_recall": 0.5, "per_class_statistics": [{"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0077841129823569884, "recall_standard_deviation": 0.0, "average_recall": 1.0, "precision_standard_deviation": 0.009883783146741298, "average_f_measure": 0.7460765297125727, "average_accuracy": 0.5950550278908487, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.5950550278908487}, {"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0, "recall_standard_deviation": 0.0, "average_recall": 0.0, "precision_standard_deviation": 0.0, "average_f_measure": 0.0, "average_accuracy": 0.5950550278908487, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.0}], "average_f_measure": 0.3730366666666667, "average_accuracy": 0.5950533333333333, "accuracy_standard_deviation": 0.009883037095054467, "average_phi_standard_deviation": 0.0, "average_precision_standard_deviation": 0.004944035688472412, "average_precision": 0.29752666666666666, "confusion_matrix": [[119, 0], [81, 0]]}, "model": {"average_phi": 0.32033666666666666, "average_f_measure_standard_deviation": 0.02871442649416642, "average_recall_standard_deviation": 0.030342171972355576, "average_recall": 0.6606799999999999, "per_class_statistics": [{"accuracy_standard_deviation": 0.024485610381813242, "present_in_test_data": true, "f_measure_standard_deviation": 0.016395108062453877, "recall_standard_deviation": 0.028963830878526903, "average_recall": 0.7145299145299145, "precision_standard_deviation": 0.03910149062474531, "average_f_measure": 0.7204777108499831, "average_accuracy": 0.6699834162520729, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.32033571959995855, "phi_coefficient_standard_deviation": 0.05602295509959492, "average_precision": 0.7291921664626683}, {"accuracy_standard_deviation": 0.024485610381813242, "present_in_test_data": true, "f_measure_standard_deviation": 0.04332189074181274, "recall_standard_deviation": 0.07572668866098012, "average_recall": 0.6068376068376068, "precision_standard_deviation": 0.022587498622553798, "average_f_measure": 0.5961538461538461, "average_accuracy": 0.6699834162520729, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.32033571959995855, "phi_coefficient_standard_deviation": 0.05602295509959492, "average_precision": 0.5902298850574712}], "average_f_measure": 0.6583133333333333, "average_accuracy": 0.6699833333333333, "accuracy_standard_deviation": 0.024484772592141595, "average_phi_standard_deviation": 0.05602434728659395, "average_precision_standard_deviation": 0.025754464985059705, "average_precision": 0.65971, "confusion_matrix": [[85, 34], [32, 49]]}, "nodes": "28", "class_names": ["true", "false"]}, {"name": "node_th33", "random": {"average_phi": 0.054143333333333335, "average_f_measure_standard_deviation": 0.039868625369943324, "average_recall_standard_deviation": 0.03717917786431898, "average_recall": 0.52728, "per_class_statistics": [{"accuracy_standard_deviation": 0.04012532380151739, "present_in_test_data": true, "f_measure_standard_deviation": 0.04352202420136825, "recall_standard_deviation": 0.05348628216667474, "average_recall": 0.4628205128205128, "precision_standard_deviation": 0.028867925698633858, "average_f_measure": 0.5305885351767392, "average_accuracy": 0.5147746117895372, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.054143414991316564, "phi_coefficient_standard_deviation": 0.07338140514100441, "average_precision": 0.6240288420604513}, {"accuracy_standard_deviation": 0.04012532380151739, "present_in_test_data": true, "f_measure_standard_deviation": 0.03955265486186256, "recall_standard_deviation": 0.0387791457700744, "average_recall": 0.5917446750780084, "precision_standard_deviation": 0.04394541702315126, "average_f_measure": 0.4971965568980494, "average_accuracy": 0.5147746117895372, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.054143414991316564, "phi_coefficient_standard_deviation": 0.07338140514100441, "average_precision": 0.4296975546975548}], "average_f_measure": 0.5138933333333333, "average_accuracy": 0.5147733333333333, "accuracy_standard_deviation": 0.04012253343059095, "average_phi_standard_deviation": 0.07337935465026174, "average_precision_standard_deviation": 0.03620893904364871, "average_precision": 0.52686, "confusion_matrix": [[55, 64], [33, 48]]}, "mode": {"average_phi": 0.0, "average_f_measure_standard_deviation": 0.003894477571582021, "average_recall_standard_deviation": 0.0, "average_recall": 0.5, "per_class_statistics": [{"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0077841129823569884, "recall_standard_deviation": 0.0, "average_recall": 1.0, "precision_standard_deviation": 0.009883783146741298, "average_f_measure": 0.7460765297125727, "average_accuracy": 0.5950550278908487, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.5950550278908487}, {"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0, "recall_standard_deviation": 0.0, "average_recall": 0.0, "precision_standard_deviation": 0.0, "average_f_measure": 0.0, "average_accuracy": 0.5950550278908487, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.0}], "average_f_measure": 0.3730366666666667, "average_accuracy": 0.5950533333333333, "accuracy_standard_deviation": 0.009883037095054467, "average_phi_standard_deviation": 0.0, "average_precision_standard_deviation": 0.004944035688472412, "average_precision": 0.29752666666666666, "confusion_matrix": [[119, 0], [81, 0]]}, "model": {"average_phi": 0.3583533333333333, "average_f_measure_standard_deviation": 0.03730380171272388, "average_recall_standard_deviation": 0.03905182226506497, "average_recall": 0.6768733333333333, "per_class_statistics": [{"accuracy_standard_deviation": 0.035801931121055286, "present_in_test_data": true, "f_measure_standard_deviation": 0.03296921226676425, "recall_standard_deviation": 0.06131175596398969, "average_recall": 0.7478632478632479, "precision_standard_deviation": 0.049426460365313445, "average_f_measure": 0.7409203628715824, "average_accuracy": 0.6901854364540931, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.35835288221085726, "phi_coefficient_standard_deviation": 0.07629648223611375, "average_precision": 0.7395120839033288}, {"accuracy_standard_deviation": 0.035801931121055286, "present_in_test_data": true, "f_measure_standard_deviation": 0.05339743162222136, "recall_standard_deviation": 0.10039338789337741, "average_recall": 0.6058879392212725, "precision_standard_deviation": 0.04210437373871983, "average_f_measure": 0.610042735042735, "average_accuracy": 0.6901854364540931, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.35835288221085726, "phi_coefficient_standard_deviation": 0.07629648223611375, "average_precision": 0.6237373737373737}], "average_f_measure": 0.6754833333333333, "average_accuracy": 0.6901833333333333, "accuracy_standard_deviation": 0.035801193027917684, "average_phi_standard_deviation": 0.0762972312006726, "average_precision_standard_deviation": 0.037852575723309634, "average_precision": 0.6816266666666667, "confusion_matrix": [[89, 30], [32, 49]]}, "nodes": "33", "class_names": ["true", "false"]}, {"name": "node_th23", "random": {"average_phi": -0.029623333333333342, "average_f_measure_standard_deviation": 0.026160849884257698, "average_recall_standard_deviation": 0.028289532025507644, "average_recall": 0.4850066666666667, "per_class_statistics": [{"accuracy_standard_deviation": 0.026559896149331647, "present_in_test_data": true, "f_measure_standard_deviation": 0.02759308446721396, "recall_standard_deviation": 0.027301973639803665, "average_recall": 0.4871794871794872, "precision_standard_deviation": 0.03669698182390763, "average_f_measure": 0.5294539841790469, "average_accuracy": 0.4850746268656716, "class_name": "false", "occurrences": 3, "average_phi_coefficient": -0.029622307480195027, "phi_coefficient_standard_deviation": 0.05578146692764718, "average_precision": 0.5807716635041114}, {"accuracy_standard_deviation": 0.026559896149331647, "present_in_test_data": true, "f_measure_standard_deviation": 0.027623248936822754, "recall_standard_deviation": 0.04487270494788015, "average_recall": 0.4828381495048162, "precision_standard_deviation": 0.018789177007933193, "average_f_measure": 0.43104566083171253, "average_accuracy": 0.4850746268656716, "class_name": "true", "occurrences": 3, "average_phi_coefficient": -0.029622307480195027, "phi_coefficient_standard_deviation": 0.05578146692764718, "average_precision": 0.38996212121212115}], "average_f_measure": 0.48025000000000007, "average_accuracy": 0.48507333333333336, "accuracy_standard_deviation": 0.02655970046685183, "average_phi_standard_deviation": 0.055780117325879564, "average_precision_standard_deviation": 0.027502160319186234, "average_precision": 0.4853666666666666, "confusion_matrix": [[58, 61], [42, 39]]}, "mode": {"average_phi": 0.0, "average_f_measure_standard_deviation": 0.003894477571582021, "average_recall_standard_deviation": 0.0, "average_recall": 0.5, "per_class_statistics": [{"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0077841129823569884, "recall_standard_deviation": 0.0, "average_recall": 1.0, "precision_standard_deviation": 0.009883783146741298, "average_f_measure": 0.7460765297125727, "average_accuracy": 0.5950550278908487, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.5950550278908487}, {"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0, "recall_standard_deviation": 0.0, "average_recall": 0.0, "precision_standard_deviation": 0.0, "average_f_measure": 0.0, "average_accuracy": 0.5950550278908487, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.0}], "average_f_measure": 0.3730366666666667, "average_accuracy": 0.5950533333333333, "accuracy_standard_deviation": 0.009883037095054467, "average_phi_standard_deviation": 0.0, "average_precision_standard_deviation": 0.004944035688472412, "average_precision": 0.29752666666666666, "confusion_matrix": [[119, 0], [81, 0]]}, "model": {"average_phi": 0.32684666666666673, "average_f_measure_standard_deviation": 0.045686967020754976, "average_recall_standard_deviation": 0.05053904695051804, "average_recall": 0.6639499999999999, "per_class_statistics": [{"accuracy_standard_deviation": 0.03482015952148031, "present_in_test_data": true, "f_measure_standard_deviation": 0.014979926752541808, "recall_standard_deviation": 0.044420810613001065, "average_recall": 0.7064102564102565, "precision_standard_deviation": 0.06813167658473598, "average_f_measure": 0.7187115653759701, "average_accuracy": 0.6702095582692597, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.3268464599765568, "phi_coefficient_standard_deviation": 0.09160641577613012, "average_precision": 0.7401185770750989}, {"accuracy_standard_deviation": 0.03482015952148031, "present_in_test_data": true, "f_measure_standard_deviation": 0.07875544394203968, "recall_standard_deviation": 0.14269529460312924, "average_recall": 0.6214896214896215, "precision_standard_deviation": 0.014644939149775004, "average_f_measure": 0.5961505584115586, "average_accuracy": 0.6702095582692597, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.3268464599765568, "phi_coefficient_standard_deviation": 0.09160641577613012, "average_precision": 0.5860447795931667}], "average_f_measure": 0.6574333333333333, "average_accuracy": 0.67021, "accuracy_standard_deviation": 0.034817852700398756, "average_phi_standard_deviation": 0.09160453421577389, "average_precision_standard_deviation": 0.040986085443721, "average_precision": 0.66308, "confusion_matrix": [[84, 35], [31, 50]]}, "nodes": "23", "class_names": ["true", "false"]}, {"name": "node_th8", "random": {"average_phi": -0.044939999999999994, "average_f_measure_standard_deviation": 0.026638867593549605, "average_recall_standard_deviation": 0.02822947513976599, "average_recall": 0.47717999999999994, "per_class_statistics": [{"accuracy_standard_deviation": 0.023265167163476617, "present_in_test_data": true, "f_measure_standard_deviation": 0.028598419014514643, "recall_standard_deviation": 0.044428004849118026, "average_recall": 0.4623931623931624, "precision_standard_deviation": 0.015666717704860667, "average_f_measure": 0.5107050974578119, "average_accuracy": 0.4748982360922659, "class_name": "false", "occurrences": 3, "average_phi_coefficient": -0.04494049452647138, "phi_coefficient_standard_deviation": 0.055456266089121145, "average_precision": 0.5735780423280423}, {"accuracy_standard_deviation": 0.023265167163476617, "present_in_test_data": true, "f_measure_standard_deviation": 0.0517774173679918, "recall_standard_deviation": 0.07633631431098135, "average_recall": 0.491961741961742, "precision_standard_deviation": 0.03891911465325819, "average_f_measure": 0.4292929292929292, "average_accuracy": 0.4748982360922659, "class_name": "true", "occurrences": 3, "average_phi_coefficient": -0.04494049452647138, "phi_coefficient_standard_deviation": 0.055456266089121145, "average_precision": 0.3821733821733822}], "average_f_measure": 0.47000000000000003, "average_accuracy": 0.4749, "accuracy_standard_deviation": 0.023261987590630924, "average_phi_standard_deviation": 0.055458916325510726, "average_precision_standard_deviation": 0.027238523373258588, "average_precision": 0.47787333333333337, "confusion_matrix": [[55, 64], [41, 40]]}, "mode": {"average_phi": 0.0, "average_f_measure_standard_deviation": 0.003894477571582021, "average_recall_standard_deviation": 0.0, "average_recall": 0.5, "per_class_statistics": [{"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0077841129823569884, "recall_standard_deviation": 0.0, "average_recall": 1.0, "precision_standard_deviation": 0.009883783146741298, "average_f_measure": 0.7460765297125727, "average_accuracy": 0.5950550278908487, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.5950550278908487}, {"accuracy_standard_deviation": 0.009883783146741298, "present_in_test_data": true, "f_measure_standard_deviation": 0.0, "recall_standard_deviation": 0.0, "average_recall": 0.0, "precision_standard_deviation": 0.0, "average_f_measure": 0.0, "average_accuracy": 0.5950550278908487, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.0, "phi_coefficient_standard_deviation": 0.0, "average_precision": 0.0}], "average_f_measure": 0.3730366666666667, "average_accuracy": 0.5950533333333333, "accuracy_standard_deviation": 0.009883037095054467, "average_phi_standard_deviation": 0.0, "average_precision_standard_deviation": 0.004944035688472412, "average_precision": 0.29752666666666666, "confusion_matrix": [[119, 0], [81, 0]]}, "model": {"average_phi": 0.35724333333333336, "average_f_measure_standard_deviation": 0.06345051632746754, "average_recall_standard_deviation": 0.061536294078282705, "average_recall": 0.6768066666666668, "per_class_statistics": [{"accuracy_standard_deviation": 0.06569727244783645, "present_in_test_data": true, "f_measure_standard_deviation": 0.06244073895245762, "recall_standard_deviation": 0.07647722165520114, "average_recall": 0.7472222222222222, "precision_standard_deviation": 0.05112078050422643, "average_f_measure": 0.7400403300967584, "average_accuracy": 0.6904115784712799, "class_name": "false", "occurrences": 3, "average_phi_coefficient": 0.3572435076755374, "phi_coefficient_standard_deviation": 0.12835017968446888, "average_precision": 0.7336513615583382}, {"accuracy_standard_deviation": 0.06569727244783645, "present_in_test_data": true, "f_measure_standard_deviation": 0.06458960732841498, "recall_standard_deviation": 0.05094841632713962, "average_recall": 0.606396689730023, "precision_standard_deviation": 0.08426208529827382, "average_f_measure": 0.6159245516388373, "average_accuracy": 0.6904115784712799, "class_name": "true", "occurrences": 3, "average_phi_coefficient": 0.3572435076755374, "phi_coefficient_standard_deviation": 0.12835017968446888, "average_precision": 0.6273291925465838}], "average_f_measure": 0.6779833333333334, "average_accuracy": 0.6904133333333333, "accuracy_standard_deviation": 0.06569847503726568, "average_phi_standard_deviation": 0.12834892294920988, "average_precision_standard_deviation": 0.06693638970445497, "average_precision": 0.68049, "confusion_matrix": [[89, 30], [32, 49]]}, "nodes": "8", "class_names": ["true", "false"]}]
<!DOCTYPE html>
<meta charset="utf-8">
<style>
html, body{
height: 100%;
}
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
font: 14px/18px "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 0;
position: relative;
background: #fff;
display: block;
color: #333;
}
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.clearfix { display: inline-table; }
* html .clearfix { height: 1%; }
.clearfix { display: block; }
#wrap{
min-height: 100%;
height: auto;
margin: 0 auto -60px;
padding: 0 0 60px;
}
#header{
height: 100px;
background: #F7F7F7;
border-bottom: 1px solid #D6D8D9;
border-top: 4px solid #293A44;
}
#header img{
margin-top: 10px;
}
#footer {
height: 60px;
background-color: #293A43;
color: #5D6F79;
text-align: center;
font-size: 11px;
padding-top: 20px;
float: bottom;
}
.container{
width: 960px;
margin: 0 auto;
padding: 0 30px;
}
#chart {
float: left;
width: 720px;
margin-top: 30px;
}
#metrics_chart {
float: left;
width: 720px;
margin-top: 30px;
}
#metrics {
float: left;
margin-top: 30px;
}
.sliders{
float: left;
width: 170px;
margin-top: 30px;
}
.slider_box{
background: #eee;
padding: 10px 10px 5px;
margin-top:20px;
border-radius:5px;
}
.sliders label{
display: block;
}
.sliders input{
float: left;
margin-bottom: 10px;
}
.sliders .value_slider{
display: block;
font-weight: bold;
text-align: center;
}
.sliders button {
float: left;
background: #eee;
margin-top:20px;
border-radius:5px;
}
.legend{
font-size: 12px;
}
.axis path,
.axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}
.axis text {
font-family: sans-serif;
font-size: 11px;
}
.site-title {
background: url(https://static.bigml.com/static/img/logo_menu.png) no-repeat 0 0 transparent;
margin: 20px 0 0 0;
padding: 17px 0 12px 185px;
color: #25343d;
}
.bottom {
margin-top: 150px;
float: bottom;
height: 70px;
}
.hidden {
display: none;
}
</style>
<body>
<div id="wrap">
<div id="header">
<div class="container clearfix">
<h2 class="site-title"></h2>
</div>
</div>
<div class="container clearfix">
<!-- h3>@@SUBTITLE@@</h3 -->
<div id="ROC_chart" class="hidden">
<div id="chart"></div>
<div class="sliders">
<div class="clearfix slider_box">
<label>Positive class:</label>
<div id="classes"></div>
</div>
<div class="clearfix slider_box">
<label>Iso-cost line:</label>
<input id="isoline" type="range" min="0" max="100" value="20">
</div>
<div class="clearfix slider_box">
<label>P(+):</label>
<input id="prevalence" type="range" min="0" max="40" value="20">
<div id="prevalencedisplay" class="value_slider">0.5</div>
</div>
<div class="clearfix slider_box">
<label>FP cost:</label>
<input id="fpcost" type="range" min="1" max="250" value="25">
<div id="fpcostdisplay" class="value_slider">0.25</div>
</div>
<div class="clearfix slider_box">
<label>FN cost:</label>
<input id="fncost" type="range" min="1" max="250" value="25">
<div id="fncostdisplay" class="value_slider">0.25</div>
</div>
</div>
</div>
<div id="metrics_chart"></div>
<div class="sliders bottom">
<div id="tooltip" class="slider_box"></div>
</div>
</div>
</div>
<div id="footer">
bigmler analyze results - Powered by BigML <br/>
Copyright © 2015 BigML, Inc.
</div>
</body>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"
charset="utf-8"></script>
<script>
// Computes Area Under the Curve using Heron's formula
var AUC = function(tpr, fpr) {
a = Math.sqrt(2);
b = Math.sqrt(tpr * tpr + fpr * fpr);
c = Math.sqrt((1 - tpr) * (1 - tpr) + (1 - fpr) * (1 - fpr));
s = (a + b + c) /2;
if (tpr == fpr) {
return 0.5
} else if (tpr > fpr) {
return 0.5 + Math.sqrt(s * (s - a) * (s - b) * (s - c));
} else {
return 0.5 - Math.sqrt(s * (s - a) * (s - b) * (s - c));
}
};
</script>
<script>
var margin = {top: 20, right: 60, bottom: 30, left: 60};
var width = 720 - margin.left - margin.right;
var height = 480 - margin.top - margin.bottom;
var xPadding = 20;
var yPadding = 35;
var xScale = d3.scale.linear()
.domain([0, 1])
.range([0, width]);
var yScale = d3.scale.linear()
.domain([0, 1])
.range([height, 0]);
var xAxis = d3.svg.axis()
.scale(xScale)
.orient("bottom")
.ticks(15);
var yAxis = d3.svg.axis()
.scale(yScale)
.orient("left")
.ticks(25);
var lineFunction = d3.svg.line()
.x(function(d) { return xScale(d.x); })
.y(function(d) { return yScale(d.y); })
.interpolate("linear");
// SVG panel.
var svg = d3.select("#chart")
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
svg.append('text')
.attr("text-anchor", "middle")
.attr({'id': 'rocTitle', 'x': 90, 'y': -10})
.style({'font-size': '15px', 'font-weight': 'bold', 'fill': 'black'});
d3.select('svg #rocTitle')
.text("ROC curve and cost line")
.transition()
.style('opacity', 1);
// Adds X axis
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis)
.append("text")
.attr("class", "label")
.attr("x", width)
.attr("y", -6)
.style("text-anchor", "end")
.text("False Positive Rate");
// Adds Y axis
svg.append("g")
.attr("class", "y axis")
.call(yAxis)
.append("text")
.attr("class", "label")
.attr("transform", "rotate(-90)")
.attr("y", 6)
.attr("dy", ".71em")
.style("text-anchor", "end")
.text("True Positive Rate")
// Draw X-axis grid lines
svg.selectAll("line.x")
.data(xScale.ticks(10))
.enter().append("line")
.attr("class", "x")
.attr("x1", xScale)
.attr("x2", xScale)
.attr("y1", 0)
.attr("y2", height)
.style("stroke", "#ccc");
// Draw Y-axis grid lines
svg.selectAll("line.y")
.data(yScale.ticks(10))
.enter().append("line")
.attr("class", "y")
.attr("x1", 0)
.attr("x2", width)
.attr("y1", yScale)
.attr("y2", yScale)
.style("stroke", "#ccc");
</script>
<script>
// Loads multiple evaluations
var loadEvaluations = function(options) {
$.getJSON("evaluations_json.json", function( data ) {
var evaluations_json = data;
var classes = evaluations_json[0].class_names;
if (typeof classes !== 'undefined') {
$("#ROC_chart").show();
var settings = $.extend({
callback: function() {},
maxInstances: 1,
urls: [ ],
evaluations_ids: [],
evaluations_json: evaluations_json,
evaluations: [ ]
}, options || {});
var s = $('<select id="positiveClass" />');
for(var i=0; i < classes.length; i++) {
$('<option />', {value: classes[i], text: classes[i]}).appendTo(s);
}
s.appendTo('#classes');
$("#positiveClass").click(function (){changePositiveClass(settings)})
changePositiveClass(settings);
} else {
$("#ROC_chart").hide();
}
});
};
changePositiveClass = function(settings) {
settings.evaluations = [];
settings.positiveClass = $("#positiveClass").val();
svg.selectAll('circle').data([]).exit().remove();
if ('urls' in settings && settings.urls.length > 0) {
$.ajax({
url : settings.urls[settings.evaluations.length],
dataType: 'jsonp',
crossDomain:true,
success: function(evaluation) {
processEvaluation(settings, evaluation)
}
});
} else {
settings.maxAUC = - Infinity;
for(var i =0;i<settings.evaluations_json.length;i++) {
processEvaluation(settings,
settings.evaluations_ids[i] || undefined,
settings.evaluations_json[i])
}
}
if (settings.evaluations.length < settings.urls.length) {
loadEvaluations(settings);
} else {
settings.callback(settings.evaluations,
settings.maxInstances,
settings.maxAUC);
}
}
var processEvaluation = function(settings, evaluation_id, evaluation) {
var positiveClass = settings.positiveClass;
var positiveClassIndex = evaluation.class_names.indexOf(positiveClass);
var truePositiveRate = falsePositiveRate = 0;
if( positiveClassIndex >= 0 ) {
var confusionMatrix = evaluation.model.confusion_matrix;
var tpPlusFN = confusionMatrix[positiveClassIndex].reduce(
function(total, currentValue) {
return total += currentValue;
});
if (tpPlusFN != 0) {
truePositiveRate = (
confusionMatrix[positiveClassIndex][positiveClassIndex] /
tpPlusFN);
} else {
truePositiveRate = NaN;
}
var fp = 0
var fpPlusTN = 0
for (var i=0;i<confusionMatrix.length;i++) {
if( i == positiveClassIndex )
continue;
fp += confusionMatrix[i][positiveClassIndex]
fpPlusTN += confusionMatrix[i].reduce(
function(total, currentValue, index, array) {
return total += currentValue;
});
}
if (fpPlusTN != 0) {
falsePositiveRate = fp / fpPlusTN;
} else {
falsePositiveRate = NaN;
}
}
//if (evaluation.sampled_rows > settings.maxInstances) {
// settings.maxInstances = evaluation.sampled_rows
//}
settings.maxInstances = 0.5;
result = {
"resource_id": evaluation_id,
"resource": evaluation.name,
"fields": evaluation.model_fields,
"nodes": evaluation.nodes,
"tpr": truePositiveRate,
"fpr": falsePositiveRate,
"instances": settings.maxInstances,
"auc": AUC(truePositiveRate, falsePositiveRate)}
if (result.auc > settings.maxAUC) {
settings.maxAUC = result.auc;
}
settings.evaluations.push(result);
};
</script>
<script>
var isocost = 0.2
var prevalence = 0.5
var pcostpcost = 0.25
var fncost = 0.25
var costfp = (1 - prevalence) * fpcost
var costfn = prevalence * fncost
var slope = costfp / costfn;
var updateCostLines= function () {
costfp = (1 - prevalence) * fpcost;
costfn = Math.max(prevalence * fncost, 0.0001);
slope = costfp / costfn;
if (slope == 0) {
slope = 0.0001;
}
isoCostLines.attr("x1", function (cost) {
if (1 - cost/(costfn) < 0) {
return xScale(Math.min(1, (-1 + cost/(costfn))/slope))
} else {
return 0
}
})
.attr("x2", function (cost) {
if (slope + 1 - cost/(costfn) > 1) {
return xScale((1- (1 - cost / (costfn))) / slope)
} else {
return xScale(1)
}
})
.attr("y1", function (cost) {
return yScale(Math.max(0, 1 - cost / (costfn)));})
.attr("y2", function (cost) {
return yScale(Math.max(0, Math.min(1, slope + 1 - cost / (costfn))));})
}
// Draw Y-axis grid lines
var isoCostLines = svg.selectAll("iso-cost")
.data([isocost])
.enter().append("line")
.attr("class", "y")
.attr("x1", function (cost) {
if (1 - cost/(costfn) < 0) {
return xScale(Math.min(1, (-1 + cost / (costfn)) / slope))
} else {
return 0
}
})
.attr("x2", function (cost) {
if (slope + 1 - cost/(costfn) > 1) {
return xScale((1- (1 - cost / (costfn))) / slope)
} else {
return xScale(1)
}
})
.attr("y1", function (cost) {
return yScale(Math.max(0, 1 - cost / (costfn)));})
.attr("y2", function (cost) {
return yScale(Math.max(0, Math.min(1, slope + 1 - cost / (costfn))));})
.style("stroke", "red");
d3.select("#selectAll").on("click", function() {
d3.selectAll("circle").style("opacity", 1);
});
d3.select("#unselectAll").on("click", function() {
d3.selectAll("circle").style("opacity", 0);
});
d3.select("#isoline").on("change", function() {
isocost = this.value/100;
isoCostLines.data([isocost]);
updateCostLines();});
d3.select("#prevalence").on("change", function() {
prevalence = this.value/40;
$("#prevalencedisplay").html(prevalence);
updateCostLines();});
d3.select("#fpcost").on("change", function() {
fpcost = this.value/100;
$("#fpcostdisplay").html(fpcost);
updateCostLines();});
d3.select("#fncost").on("change", function() {
fncost = this.value/100;
$("#fncostdisplay").html(fncost);
updateCostLines();});
// Evaluation info
svg.append('text')
.attr("text-anchor", "middle")
.attr({'id': 'evaluationLabel', 'x': width/2, 'y': height-20})
.style({'font-size': '15px', 'font-weight': 'bold', 'fill': 'black'});
var line = d3.svg.line()
.interpolate("basis")
.x(function(d) {
return xScale(d);})
.y(function(d) {
return yScale(d) });
var data = [0.2,0.2,0.4,0.4];
svg.append("svg:path").attr("d", line(data))
var path;
loadEvaluations({
callback: function(evaluations, maxInstances, maxAUC) {
// Draw evaluations
svg.selectAll("circle").data(evaluations)
.enter()
.append("circle")
.attr("id", function(evaluation) {
return evaluation.resource
.replace("\\", "_")
.replace("/", "_");
})
.attr("cx", function(evaluation) {
return xScale(evaluation.fpr);
})
.attr("cy", function(evaluation) {
return yScale(evaluation.tpr);
})
.attr("r", function(evaluation) {
if (evaluation.auc == maxAUC) {
return 5;
}
return 3;
})
.attr("fill",
function (evaluation){
if (evaluation.auc == maxAUC) {
return "#f55";
} else {return "#000";}
})
.attr("stroke",
function (evaluation){
if (evaluation.auc == maxAUC) {
return "#f55";
} else {return "#000";}})
.on('mouseover', function(evaluation) {
d3.select("body").style("cursor", "pointer");
console.log(evaluation);
var configuration;
if (typeof evaluation.nodes === 'undefined') {
configuration = ", fields: " + evaluation.fields;
} else {
configuration = ", node threshold: " + evaluation.nodes;
}
d3.select('svg #evaluationLabel')
.text(evaluation.resource + configuration +
", AUC: " + evaluation.auc.toFixed(2))
.transition()
.style('opacity', 1);
auc = [{"x": evaluation.fpr, "y": evaluation.tpr},
{"x": 0, "y": 0},
{"x": 1, "y": 0},
{"x": 1, "y": 1},
{"x": evaluation.fpr, "y": evaluation.tpr}];
path = svg.append("path")
.attr("d", lineFunction(auc))
.attr("stroke", "blue")
.attr("stroke-width", 2)
.attr("fill", "yellow")
.attr("opacity", "0.25");
})
.on('mouseout', function(evaluation) {
d3.select('svg #evaluationLabel')
.transition()
.duration(1500)
.style('opacity', 0);
path.remove();
d3.select("body").style("cursor", "default");
});
}
});
</script>
<script>
var MEASURES = ["accuracy", "precision", "recall", "f_measure", "phi",
"phi_coefficient", "mean_squared_error", "mean_absolute_error",
"r_squared"];
var MIN_MEASURES = ["mean_squared_error", "mean_absolute_error"];
var COLORS = d3.scale.category10();
var metricsForm = d3.select("#metrics");
var legendWidth = 20;
width = width + legendWidth;
var metricsList = [];
var fillMetrics = true;
// Define container
var chart = d3.select("#metrics_chart")
.append("svg")
.attr("class", "chart")
.attr("width", width + 340)
.attr("height", height + 100)
.append("g")
// move 0,0 slightly down and right to accomodate axes
.attr("transform", "translate(50,20)");
// Evaluation info
chart.append('text')
.attr("text-anchor", "middle")
.attr({'id': 'metricsLabel', 'x': width + 30, 'y': height-70})
.style({'font-size': '15px', 'font-weight': 'bold', 'fill': 'black'});
chart.append('text')
.attr("text-anchor", "middle")
.attr({'id': 'metricsTitle', 'x': 80, 'y': -10})
.style({'font-size': '15px', 'font-weight': 'bold', 'fill': 'black'});
d3.select('svg #metricsTitle')
.text("Evaluation metrics")
.transition()
.style('opacity', 1);
// add the tooltip area to the webpage
var tooltip = d3.select("#tooltip")
.style("opacity", 0);
function updateData() {
d3.json("metrics.json", function(error, data) {
var measuresLen = MEASURES.length;
var optMeasures = {};
var foundMeasures = 0;
var kfolds = 0, topRange, bottomRange, kfolds, title;
console.log(data[0]);
title = ((typeof data[0].nodes === 'undefined') ?
"Feature selection: models' perfomance" :
"Node threshold: models' perfomance");
$(".site-title").html(title);
for (var i = 0; i < measuresLen; i++) {
var measure = MEASURES[i];
var isMinOptimal = MIN_MEASURES.indexOf(measure) > -1;
var optimizer = isMinOptimal ? d3.min : d3.max;
var boundary = isMinOptimal ? + Infinity : - Infinity;
optMeasures[measure] = optimizer(data,
function (d) {
var newData;
if (d["measure"] == measure) {
newData = d.value;
} else {
newData = boundary;
}; return newData;
});
topRange = d3.max(data, function(d) { return d.value });
bottomRange = d3.min(data, function(d) {return d.value});
kfolds = d3.max(data, function(d){ return d.kfold});
if (optMeasures[measure] != boundary) {
foundMeasures += 1;
if (fillMetrics) {
metricsList.push(measure);
}
}
}
if (bottomRange > 0) {
bottomRange = 0;
}
if (topRange < 1) {
topRange = 1;
}
// Define identity (1:1) scales
var x = d3.scale.linear().domain([0,kfolds]).range([0,width]);
var y = d3.scale.linear().domain([topRange, bottomRange])
.range([0,height]);
// Draw X-axis grid lines
chart.selectAll("line.x")
.data(x.ticks(5))
.enter().append("line")
.attr("class", "x")
.attr("x1", x)
.attr("x2", x)
.attr("y1", 0)
.attr("y2", height)
.style("stroke", "#ccc");
// Draw Y-axis grid lines
chart.selectAll("line.y")
.data(y.ticks(10))
.enter().append("line")
.attr("class", "y")
.attr("x1", 0)
.attr("x2", width)
.attr("y1", y)
.attr("y2", y)
.style("stroke", "#ccc");
// Define stock x and y axis
var xAxis = d3.svg.axis().scale(x).orient('bottom').ticks(5)
.tickFormat(d3.format("d")).tickSubdivide(0);
var yAxis = d3.svg.axis().scale(y).orient('left').ticks(10);
chart.append('g')
.attr("class", "axis")
.attr("transform", "translate(" + 0 + "," + height + ")")
.call(xAxis)
.append("text")
.attr("class", "label")
.attr("x", width)
.attr("y", -6)
.style("text-anchor", "end")
.text("Evaluation number");
chart.append('g')
.attr("class", "axis")
.call(yAxis);
var filteredData = data.filter(
function(d) {return metricsList.indexOf(d.measure) > -1;}
);
chart.selectAll(".dot").data([]).exit().remove();
chart.selectAll(".dot")
.data(filteredData)
.enter().append("circle")
.attr("class", "dot")
.attr("r", function(d) {
if (d.value == optMeasures[d.measure]) {return 5;} return 3;})
.attr("cx", function(d) {return x(d.kfold);})
.attr("cy", function(d) {return y(d.value);})
.style("fill", function(d) {
if (d.value == optMeasures[d.measure]) {return COLORS[10];}
return COLORS(MEASURES.indexOf(d.measure));})
.on("mouseover", function(d) {
var str = "";
var suffix = "";
if (d.value == optMeasures[d.measure]) {
suffix = " (optimal value)";
}
if (typeof d.model_fields !== 'undefined') {
str += "<b>" + d.measure.replace(/_/g, " ") + ": " +
d.value + suffix +
"<br/><br/> model_fields: <br/>" +
d.model_fields.replace(/,/g, ", ") +
"</b><br/><br/>folder: " + d.directory;
} else {
str += "<b>" + d.measure.replace(/_/g, " ") + ": " +
d.value + suffix +
"<br/><br/> node threshold: <br/>" +
d.nodes +
"</b><br/><br/>folder: " + d.directory;
}
tooltip.transition()
.duration(200)
.style("opacity", .9);
tooltip.html(str)
.style("left", (d3.event.pageX + 5) + "px")
.style("top", (d3.event.pageY - 28) + "px");
d3.select(this).style("cursor", "hand");
})
.on("mouseout", function(d) {
tooltip.transition()
.duration(500)
.style("opacity", 0);
d3.select(this).style("cursor", "pointer");
})
// draw legend
var legend = chart.selectAll(".legend")
.data(COLORS.domain())
.enter().append("g")
.attr("class", "legend")
.attr("transform", function(d, i) {
return "translate(0," + i * 20 + ")"; });
// draw legend colored rectangles
legend.append("rect")
.attr("x", width + 48)
.attr("width", 18)
.attr("height", 18)
.style("fill", COLORS);
// draw legend text
legend.append("text")
.attr("x", width + 70)
.attr("y", 9)
.attr("dy", ".35em")
.style("text-anchor", "start")
.text(function(d) {return MEASURES[d].replace(/_/g, " ") +
" (best:" +
optMeasures[MEASURES[d]].toFixed(5) + ")";})
.on("click", function(evaluationMetric) {
fillMetrics = false;
// Determine if current line is visible
var index = metricsList.indexOf(MEASURES[evaluationMetric])
if (index > -1) {
delete metricsList[index];
}
else {
metricsList.push(MEASURES[evaluationMetric]);
}
updateData();
})
.on("mouseover", function(d) {
d3.select(this).style("cursor", "hand");
})
.on("mouseout", function(d) {
d3.select(this).style("cursor", "pointer");
});
});
}
updateData();
</script>>
[{"kfold": 3, "time": 1438642344.476623, "value": 0.5903833333333334, "measure": "accuracy", "directory": "node_th3", "nodes": "3"}, {"kfold": 3, "time": 1438642344.476623, "value": 0.6056366666666667, "measure": "precision", "directory": "node_th3", "nodes": "3"}, {"kfold": 3, "time": 1438642344.476623, "value": 0.5851833333333334, "measure": "recall", "directory": "node_th3", "nodes": "3"}, {"kfold": 3, "time": 1438642344.476623, "value": 0.18617666666666666, "measure": "phi", "directory": "node_th3", "nodes": "3"}, {"kfold": 3, "time": 1438642344.476623, "value": 0.5532766666666667, "measure": "f_measure", "directory": "node_th3", "nodes": "3"}, {"kfold": 8, "time": 1438642376.3286235, "value": 0.6904133333333333, "measure": "accuracy", "directory": "node_th8", "nodes": "8"}, {"kfold": 8, "time": 1438642376.3286235, "value": 0.68049, "measure": "precision", "directory": "node_th8", "nodes": "8"}, {"kfold": 8, "time": 1438642376.3286235, "value": 0.6768066666666668, "measure": "recall", "directory": "node_th8", "nodes": "8"}, {"kfold": 8, "time": 1438642376.3286235, "value": 0.35724333333333336, "measure": "phi", "directory": "node_th8", "nodes": "8"}, {"kfold": 8, "time": 1438642376.3286235, "value": 0.6779833333333334, "measure": "f_measure", "directory": "node_th8", "nodes": "8"}, {"kfold": 13, "time": 1438642402.436624, "value": 0.7003633333333333, "measure": "accuracy", "directory": "node_th13", "nodes": "13"}, {"kfold": 13, "time": 1438642402.436624, "value": 0.6920966666666666, "measure": "precision", "directory": "node_th13", "nodes": "13"}, {"kfold": 13, "time": 1438642402.436624, "value": 0.68601, "measure": "recall", "directory": "node_th13", "nodes": "13"}, {"kfold": 13, "time": 1438642402.436624, "value": 0.37793333333333334, "measure": "phi", "directory": "node_th13", "nodes": "13"}, {"kfold": 13, "time": 1438642402.436624, "value": 0.6852499999999999, "measure": "f_measure", "directory": "node_th13", "nodes": "13"}, {"kfold": 18, "time": 1438642428.9606245, "value": 0.6553566666666666, "measure": "accuracy", "directory": "node_th18", "nodes": "18"}, {"kfold": 18, "time": 1438642428.9606245, "value": 0.6529633333333333, "measure": "precision", "directory": "node_th18", "nodes": "18"}, {"kfold": 18, "time": 1438642428.9606245, "value": 0.6515566666666668, "measure": "recall", "directory": "node_th18", "nodes": "18"}, {"kfold": 18, "time": 1438642428.9606245, "value": 0.3042433333333333, "measure": "phi", "directory": "node_th18", "nodes": "18"}, {"kfold": 18, "time": 1438642428.9606245, "value": 0.6430833333333333, "measure": "f_measure", "directory": "node_th18", "nodes": "18"}, {"kfold": 23, "time": 1438642455.900625, "value": 0.67021, "measure": "accuracy", "directory": "node_th23", "nodes": "23"}, {"kfold": 23, "time": 1438642455.900625, "value": 0.66308, "measure": "precision", "directory": "node_th23", "nodes": "23"}, {"kfold": 23, "time": 1438642455.900625, "value": 0.6639499999999999, "measure": "recall", "directory": "node_th23", "nodes": "23"}, {"kfold": 23, "time": 1438642455.900625, "value": 0.32684666666666673, "measure": "phi", "directory": "node_th23", "nodes": "23"}, {"kfold": 23, "time": 1438642455.900625, "value": 0.6574333333333333, "measure": "f_measure", "directory": "node_th23", "nodes": "23"}, {"kfold": 28, "time": 1438642486.9326255, "value": 0.6699833333333333, "measure": "accuracy", "directory": "node_th28", "nodes": "28"}, {"kfold": 28, "time": 1438642486.9326255, "value": 0.65971, "measure": "precision", "directory": "node_th28", "nodes": "28"}, {"kfold": 28, "time": 1438642486.9326255, "value": 0.6606799999999999, "measure": "recall", "directory": "node_th28", "nodes": "28"}, {"kfold": 28, "time": 1438642486.9326255, "value": 0.32033666666666666, "measure": "phi", "directory": "node_th28", "nodes": "28"}, {"kfold": 28, "time": 1438642486.9326255, "value": 0.6583133333333333, "measure": "f_measure", "directory": "node_th28", "nodes": "28"}, {"kfold": 33, "time": 1438642517.0646262, "value": 0.6901833333333333, "measure": "accuracy", "directory": "node_th33", "nodes": "33"}, {"kfold": 33, "time": 1438642517.0646262, "value": 0.6816266666666667, "measure": "precision", "directory": "node_th33", "nodes": "33"}, {"kfold": 33, "time": 1438642517.0646262, "value": 0.6768733333333333, "measure": "recall", "directory": "node_th33", "nodes": "33"}, {"kfold": 33, "time": 1438642517.0646262, "value": 0.3583533333333333, "measure": "phi", "directory": "node_th33", "nodes": "33"}, {"kfold": 33, "time": 1438642517.0646262, "value": 0.6754833333333333, "measure": "f_measure", "directory": "node_th33", "nodes": "33"}, {"kfold": 38, "time": 1438642544.6766267, "value": 0.6852866666666667, "measure": "accuracy", "directory": "node_th38", "nodes": "38"}, {"kfold": 38, "time": 1438642544.6766267, "value": 0.6783766666666666, "measure": "precision", "directory": "node_th38", "nodes": "38"}, {"kfold": 38, "time": 1438642544.6766267, "value": 0.6709233333333334, "measure": "recall", "directory": "node_th38", "nodes": "38"}, {"kfold": 38, "time": 1438642544.6766267, "value": 0.3490566666666667, "measure": "phi", "directory": "node_th38", "nodes": "38"}, {"kfold": 38, "time": 1438642544.6766267, "value": 0.66916, "measure": "f_measure", "directory": "node_th38", "nodes": "38"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment