-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_confusion.py
35 lines (35 loc) · 1.42 KB
/
plot_confusion.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
import seaborn as sn
import pandas as pd
import matplotlib.pyplot as plt
array = [[33,2,0,0,0,0,0,0,0,1,3],
[3,31,0,0,0,0,0,0,0,0,0],
[0,4,41,0,0,0,0,0,0,0,1],
[0,1,0,30,0,6,0,0,0,0,1],
[0,0,0,0,38,10,0,0,0,0,0],
[0,0,0,3,1,39,0,0,0,0,4],
[0,2,2,0,4,1,31,0,0,0,2],
[0,1,0,0,0,0,0,36,0,2,0],
[0,0,0,0,0,0,1,5,37,5,1],
[3,0,0,0,0,0,0,0,0,39,0],
[0,0,0,0,0,0,0,0,0,0,38]]
df_cm = pd.DataFrame(array, index = [i for i in "ABCDEFGHIJK"],
columns = [i for i in "ABCDEFGHIJK"])
plt.figure(figsize = (10,7))
sn.heatmap(df_cm, annot=True)
'''
[[ 0 , 0, 0, 0, 0, 0, 0,0,0,0,0,0,0]
[ 0 ,172 , 1, 1 , 0 , 0 , 0, 0 0 0 0 0 0]
[ 0 , 14 ,104 , 0 , 0 , 1 , 0 , 0 0 0 0 0 0]
[ 0 , 3 , 0 ,108 , 0 , 0 , 0 , 0 0 0 0 0 0]
[ 0 , 0 , 0 , 0 ,152 , 34 , 0 , 0 0 0 0 0 0]
[ 0 , 0 , 0 , 0 , 0 ,201 , 0 , 0 0 0 0 0 0]
[ 0 , 0 , 0 , 0 , 0 , 0 ,194 , 0 0 0 0 1 0]
[ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 0 0 0 0 0]
[ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 0 0 0 0 0]
[ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 0 0 0 0 0]
[ 0 , 0 , 0 , 0 , 0 , 0 , 0, 0 0 0 0 0 0]
[ 0 , 0 , 0 , 0 , 0 , 0 , 0, 0 , 0 0 0 2 0]
[ 0 , 0, 0 , 1 , 0 , 0 , 0 , 0 , 0 0 0 0 0]]
'''
os.system('pause')