if yt == 0: print score if score < 0.5: Y_pred.append(0) else: Y_pred.append(1) tp, tn, fp, fn = _tp_tn_fp_fn(test_set_y, Y_pred) print tp, tn, fp, fn print "tp", "tn", "fp", "fn" print "Accuracy ", (tp+tn)/(tp+tn+fp+fn), "Negative precision ", tn/(tn+fn+0.0001), "Precision ", tp/(tp+fp+0.00001) print "True performance ", tn/(fp+tn) Y_pred = [] for xt, yt in zip(test_set_x, test_set_y): score = e.network.predict(xt.reshape(1,-1)) if yt == 1: print score if score < 0.5: Y_pred.append(0) else: Y_pred.append(1) plot_layers(e.network.weights) plt.tight_layout() plt.show()