This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
2020-05-10 13:52:13 +08:00

127 lines
3.7 KiB
Plaintext

{
"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
}