summaryrefslogtreecommitdiff
path: root/Experiment/MarkovModel/plot.ipynb
blob: 44bcd8527f1d070cbe26ee7f24fc1b6f28faab3f (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/Users/Leo/anaconda3/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc\n"
     ]
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import sys\n",
    "\n",
    "from pylab import *\n",
    "mpl.rcParams['font.sans-serif'] = ['SimHei']\n",
    "\n",
    "\n",
    "import matplotlib\n",
    "print(matplotlib.matplotlib_fname())\n",
    "\n",
    "from matplotlib.font_manager import _rebuild\n",
    "_rebuild()\n",
    "\n",
    "#折线图\n",
    "\n",
    "\n",
    "# names = ['张三', '李四', '王五', '赵六', '马七']\n",
    "# x = range(len(names))\n",
    "# y = [0.8884, 0.9210, 0.9534, 0.9675, 0.9999]\n",
    "\n",
    "# plt.plot(x,y,'ro-',color = 'r',label=\"ATT-RLSTM\")#s-:方形\n",
    "# plt.plot(x,y,'ro-',color = 'g',label=\"CNN-RLSTM\")#o-:圆形\n",
    "# #plt.xlabel(\"region length\")#横坐标名字\n",
    "# #plt.ylabel(\"accuracy\")#纵坐标名字\n",
    "# #plt.legend(loc = \"best\")#图例\n",
    "# plt.show()\n",
    "\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "names = ['流建立', '流保持(20个包)', '流保持(40个包)', '流保持(所有包)']\n",
    "x = range(len(names))\n",
    "y1 = [0.8803, 0.9864, 0.9992, 0.9999]\n",
    "y2 = [0.8626, 0.9765, 0.9920, 0.9997]\n",
    "y3 = [0.8443, 0.9640, 0.9840, 0.9995]\n",
    "plt.xticks(x, names, rotation=30)\n",
    "plt.margins(0.08)\n",
    "plt.subplots_adjust(bottom=0.15)\n",
    "plt.xlabel('SSL客户端识别阶段')\n",
    "plt.ylabel('SSL客户端识别总比例')\n",
    "plt.title('不同给定置信度下识别总比例和识别阶段的关系')\n",
    "plt.plot(x, y1, marker='o', c = '0.2', label = \"置信度0.5\")\n",
    "plt.plot(x, y2, marker='o', c = '0.2', mfc='w', label = \"置信度0.7\")\n",
    "plt.plot(x, y3, marker='s', c = '0.2', label = \"置信度0.9\")\n",
    "plt.legend()\n",
    "#plt.show()\n",
    "plt.tight_layout()\n",
    "plt.savefig(\"fig1.svg\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "names = ['流建立', '流保持(20个包)', '流保持(40个包)', '流保持(所有包)']\n",
    "x = range(len(names))\n",
    "y1 = [0.9631, 0.8786, 0.8887, 0.9286]\n",
    "y2 = [0.9868, 0.9089, 0.9114, 0.9531]\n",
    "y3 = [0.9965, 0.9309, 0.9274, 0.9746]\n",
    "plt.xticks(x, names, rotation=30)\n",
    "plt.margins(0.08)\n",
    "plt.subplots_adjust(bottom=0.15)\n",
    "plt.xlabel('SSL客户端识别阶段')\n",
    "plt.ylabel('SSL客户端识别F1值')\n",
    "plt.title('不同给定置信度下识别准确性和识别阶段的关系')\n",
    "plt.plot(x, y1, marker='o', c = '0.2', label = \"置信度0.5\")\n",
    "plt.plot(x, y2, marker='o', c = '0.2', mfc='w', label = \"置信度0.7\")\n",
    "plt.plot(x, y3, marker='s', c = '0.2', label = \"置信度0.9\")\n",
    "plt.legend()\n",
    "#plt.show()\n",
    "plt.tight_layout()\n",
    "plt.savefig(\"fig2.svg\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}