6
6
7
7
8
8
def plot_confusion_matrix_illustration ():
9
+ plt .figure (figsize = (8 , 8 ))
9
10
confusion = np .array ([[401 , 2 ], [8 , 39 ]])
10
- plt .title ("confusion_matrix" )
11
- plt .text (0.45 , .6 , confusion [0 , 0 ], size = 70 , horizontalalignment = 'right' )
12
- plt .text (0.45 , .1 , confusion [1 , 0 ], size = 70 , horizontalalignment = 'right' )
13
- plt .text (.95 , .6 , confusion [0 , 1 ], size = 70 , horizontalalignment = 'right' )
14
- plt .text (.95 , 0.1 , confusion [1 , 1 ], size = 70 , horizontalalignment = 'right' )
15
- plt .xticks ([.25 , .75 ], ["predicted 'not 9'" , "predicted '9'" ], size = 20 )
16
- plt .yticks ([.25 , .75 ], ["true '9'" , "true 'not 9'" ], size = 20 )
11
+ plt .text (0.40 , .7 , confusion [0 , 0 ], size = 70 , horizontalalignment = 'right' )
12
+ plt .text (0.40 , .2 , confusion [1 , 0 ], size = 70 , horizontalalignment = 'right' )
13
+ plt .text (.90 , .7 , confusion [0 , 1 ], size = 70 , horizontalalignment = 'right' )
14
+ plt .text (.90 , 0.2 , confusion [1 , 1 ], size = 70 , horizontalalignment = 'right' )
15
+ plt .xticks ([.25 , .75 ], ["predicted 'not nine'" , "predicted 'nine'" ], size = 20 )
16
+ plt .yticks ([.25 , .75 ], ["true 'nine'" , "true 'not nine'" ], size = 20 )
17
17
plt .plot ([.5 , .5 ], [0 , 1 ], '--' , c = 'k' )
18
18
plt .plot ([0 , 1 ], [.5 , .5 ], '--' , c = 'k' )
19
19
@@ -22,7 +22,6 @@ def plot_confusion_matrix_illustration():
22
22
23
23
24
24
def plot_binary_confusion_matrix ():
25
- plt .title ("binary_confusion_matrix_tp_fp" )
26
25
plt .text (0.45 , .6 , "TN" , size = 100 , horizontalalignment = 'right' )
27
26
plt .text (0.45 , .1 , "FN" , size = 100 , horizontalalignment = 'right' )
28
27
plt .text (.95 , .6 , "FP" , size = 100 , horizontalalignment = 'right' )
0 commit comments