|
575 | 575 | "outputs": [], |
576 | 576 | "source": [ |
577 | 577 | "plt.figure(figsize=(10, 10))\n", |
578 | | - "N = 500\n", |
579 | | - "predict_threshold = np.linspace(0, 1, N, endpoint=False)\n", |
| 578 | + "Nt = 500\n", |
| 579 | + "predict_threshold = np.linspace(0, 1, Nt, endpoint=False)\n", |
580 | 580 | "TPR = np.zeros_like(predict_threshold)\n", |
581 | 581 | "FPR = np.zeros_like(predict_threshold)\n", |
582 | 582 | "TNR = np.zeros_like(predict_threshold)\n", |
|
593 | 593 | " TPR[idx] = TP / (FN+TP) # recall, sensitivity, test power\n", |
594 | 594 | " FNR[idx] = FN / (FN+TP) # type II error\n", |
595 | 595 | " TNR[idx] = TN / (TN+FP) # specificity, selectivity\n", |
596 | | - " if idx == N//2: # indicate 0.5 probability decision point\n", |
| 596 | + " if idx == Nt//2: # indicate 0.5 probability decision point\n", |
597 | 597 | " plt.subplot(2, 2, 1)\n", |
598 | 598 | " plt.text(FPR[idx], TPR[idx], '. %0.2f' % val)\n", |
599 | 599 | " plt.subplot(2, 2, 2)\n", |
|
0 commit comments