Merge pull request #65 from patsancu/remove-hardcoded-recall-precision-threshold-coordinates

remove hardcoded values for recall-precision-threshold intersection
main
Aurélien Geron 2020-02-05 09:29:48 +13:00 committed by GitHub
commit c29e8d9e37
1 changed files with 13 additions and 7 deletions

View File

@ -495,14 +495,20 @@
" plt.grid(True) # Not shown\n",
" plt.axis([-50000, 50000, 0, 1]) # Not shown\n",
"\n",
"plt.figure(figsize=(8, 4)) # Not shown\n",
"\n",
"\n",
"recall_90_precision = recalls[np.argmax(precisions >= 0.90)]\n",
"threshold_90_precision = thresholds[np.argmax(precisions >= 0.90)]\n",
"\n",
"\n",
"plt.figure(figsize=(8, 4)) # Not shown\n",
"plot_precision_recall_vs_threshold(precisions, recalls, thresholds)\n",
"plt.plot([7813, 7813], [0., 0.9], \"r:\") # Not shown\n",
"plt.plot([-50000, 7813], [0.9, 0.9], \"r:\") # Not shown\n",
"plt.plot([-50000, 7813], [0.4368, 0.4368], \"r:\")# Not shown\n",
"plt.plot([7813], [0.9], \"ro\") # Not shown\n",
"plt.plot([7813], [0.4368], \"ro\") # Not shown\n",
"save_fig(\"precision_recall_vs_threshold_plot\") # Not shown\n",
"plt.plot([threshold_90_precision, threshold_90_precision], [0., 0.9], \"r:\") # Not shown\n",
"plt.plot([-50000, threshold_90_precision], [0.9, 0.9], \"r:\") # Not shown\n",
"plt.plot([-50000, threshold_90_precision], [recall_90_precision, recall_90_precision], \"r:\")# Not shown\n",
"plt.plot([threshold_90_precision], [0.9], \"ro\") # Not shown\n",
"plt.plot([threshold_90_precision], [recall_90_precision], \"ro\") # Not shown\n",
"save_fig(\"precision_recall_vs_threshold_plot\") # Not shown\n",
"plt.show()"
]
},