Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3242463

Browse files
committedApr 26, 2018
feat: Change precision-recall plots to work with any number of classes
The plprecision-recall plots now look as they should with any number of classes.
1 parent 94a4ae8 commit 3242463

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎ssd300_evaluation.ipynb

+3-2
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,13 @@
401401
}
402402
],
403403
"source": [
404-
"m = 10\n",
404+
"m = (n_classes + 1) // 2\n",
405405
"n = 2\n",
406406
"\n",
407-
"fig, cells = plt.subplots(m, n, figsize=(16,80))\n",
407+
"fig, cells = plt.subplots(m, n, figsize=(n*8,m*8))\n",
408408
"for i in range(m):\n",
409409
" for j in range(n):\n",
410+
" if n*i+j+1 > n_classes: break\n",
410411
" cells[i, j].plot(recalls[n*i+j+1], precisions[n*i+j+1], color='blue', linewidth=1.0)\n",
411412
" cells[i, j].set_xlabel('recall', fontsize=14)\n",
412413
" cells[i, j].set_ylabel('precision', fontsize=14)\n",

0 commit comments

Comments
 (0)
Please sign in to comment.