#可视化展示数据
import matplotlib.pyplot as plt
import pandas as pd
f = pd.read_excel("D:/创新设计/vic(1).xlsx")
d = pd.read_excel('D:/创新设计/vic(2).xlsx')
list1 = f['length']
dist1 = d['length']
x1_data = []
data_dict = {}
for key in list1:
data_dict[key] = data_dict.get(key,0) + 1
for i in list1:
if not i in x1_data:
x1_data.append(i)
x1_data.sort()
y1_data = []
for i in x1_data:
y1_data.append(data_dict[i])
a1_data = []
data_dict = {}
for key in dist1:
data_dict[key] = data_dict.get(key,0) + 1
for i in dist1:
if not i in a1_data:
a1_data.append(i)
a1_data.sort()
b1_data = []
for i in a1_data:
b1_data.append(data_dict[i])
list2 = f['split']
dist2 = d['split']
x2_data = []
data_dict = {}
for key in list2:
data_dict[key] = data_dict.get(key,0) + 1
for i in list2:
if not i in x2_data:
x2_data.append(i)
x2_data.sort()
y2_data = []
for i in x2_data:
y2_data.append(data_dict[i])
a2_data = []
data_dict = {}
for key in dist2:
data_dict[key] = data_dict.get(key,0) + 1
for i in dist2:
if not i in a2_data:
a2_data.append(i)
a2_data.sort()
b2_data = []
for i in a2_data:
b2_data.append(data_dict[i])
list3 = f['special']
dist3 = d['special']
x3_data = []
data_dict = {}
for key in list3:
data_dict[key] = data_dict.get(key,0) + 1
for i in list3:
if not i in x3_data:
x3_data.append(i)
x3_data.sort()
y3_data = []
for i in x3_data:
y3_data.append(data_dict[i])
a3_data = []
data_dict = {}
for key in dist3:
data_dict[key] = data_dict.get(key,0) + 1
for i in dist3:
if not i in a3_data:
a3_data.append(i)
a3_data.sort()
b3_data = []
for i in a3_data:
b3_data.append(data_dict[i])
list4 = f['rate']
dist4 = d['rate']
x4_data = []
data_dict = {}
for key in list4:
data_dict[key] = data_dict.get(key,0) + 1
for i in list4:
if not i in x4_data:
x4_data.append(i)
x4_data.sort()
y4_data = []
for i in x4_data:
y4_data.append(data_dict[i])
a4_data = []
data_dict = {}
for key in dist4:
data_dict[key] = data_dict.get(key,0) + 1
for i in dist4:
if not i in a4_data:
a4_data.append(i)
a4_data.sort()
b4_data = []
for i in a4_data:
b4_data.append(data_dict[i])
list5 = f['max_num']
dist5 = d['max_num']
x5_data = []
data_dict = {}
for key in list5:
data_dict[key] = data_dict.get(key,0) + 1
for i in list5:
if not i in x5_data:
x5_data.append(i)
x5_data.sort()
y5_data = []
for i in x5_data:
y5_data.append(data_dict[i])
a5_data = []
data_dict = {}
for key in dist5:
data_dict[key] = data_dict.get(key,0) + 1
for i in dist5:
if not i in a5_data:
a5_data.append(i)
a5_data.sort()
b5_data = []
for i in a5_data:
b5_data.append(data_dict[i])
list6 = f['change']
dist6 = d['change']
x6_data = []
data_dict = {}
for key in list6:
data_dict[key] = data_dict.get(key,0) + 1
for i in list6:
if not i in x6_data:
x6_data.append(i)
x6_data.sort()
y6_data = []
for i in x6_data:
y6_data.append(data_dict[i])
a6_data = []
data_dict = {}
for key in dist6:
data_dict[key] = data_dict.get(key,0) + 1
for i in dist6:
if not i in a6_data:
a6_data.append(i)
a6_data.sort()
b6_data = []
for i in a6_data:
b6_data.append(data_dict[i])
plt.subplot(2,2,1)
plt.plot(x1_data,y1_data, '-', color = 'red',linewidth = 1,label = 'black_list')
plt.plot(a1_data,b1_data,'-',color = 'green',linewidth=1,label='white_list')
plt.title('length')
plt.legend()
plt.xlabel('x1')
plt.ylabel('y1')
plt.subplot(2,2,2)
plt.plot(x2_data,y2_data, '-', color = 'red',linewidth = 1,label = 'black_list')
plt.plot(a2_data,b2_data,'-',color = 'green',linewidth=1,label='white_list')
plt.title('split')
plt.legend()
plt.xlabel('x2')
plt.ylabel('y2')
plt.subplot(2,2,3)
plt.plot(x3_data,y3_data, '-', color = 'red',linewidth = 1,label = 'black_list')
plt.plot(a3_data,b3_data,'-',color = 'green',linewidth=1,label='white_list')
plt.title('special')
plt.legend()
plt.xlabel('x3')
plt.ylabel('y3')
plt.subplot(2,2,4)
plt.plot(x4_data,y4_data, '-', color = 'red',linewidth = 1,label = 'black_list')
plt.plot(a4_data,b4_data,'-',color = 'green',linewidth=1,label='white_list')
plt.title('rate')
plt.legend()
plt.xlabel('x4')
plt.ylabel('y4')
plt.show()
plt.subplot(2,2,1)
plt.plot(x5_data,y5_data, '-', color = 'red',linewidth = 1,label = 'black_list')
plt.plot(a5_data,b5_data,'-',color = 'green',linewidth=1,label='white_list')
plt.title('max_num')
plt.legend()
plt.xlabel('x5')
plt.ylabel('y5')
plt.subplot(2,2,2)
plt.plot(x6_data,y6_data, '-', color = 'red',linewidth = 1,label = 'black_list')
plt.plot(a6_data,b6_data,'-',color = 'green',linewidth=1,label='white_list')
plt.title('change')
plt.legend()
plt.xlabel('x6')
plt.ylabel('y6')
plt.show()
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于传统机器学习DNN算法的恶意网站检测python源码+数据集.zip 【项目介绍】 黑名单数据和白名单数据保存在data.zip中。 首先运行translate.py,提取出网站数据的特征。 运行typelist.py对特征数据进行可视化展示。 data.zip中的2.xlsx为白名单和黑名单特征的整合。 运行SVM.py、forest_split.py、DNN.py机器学习训练和预测数据(其中DNN用到的是DNN的分类算法)。 基于传统机器学习DNN算法的恶意网站检测python源码+数据集.zip 基于传统机器学习DNN算法的恶意网站检测python源码+数据集.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于传统机器学习DNN算法的恶意网站检测python源码+数据集.zip (7个子文件)
项目说明.md 357B
data.zip 3.31MB
typelist.py 5KB
translate.py 2KB
SVM.py 568B
DNN.py 4KB
forest_split.py 2KB
共 7 条
- 1
资源评论
- 蒽,开心(∩_∩)2024-03-14资源是宝藏资源,实用也是真的实用,感谢大佬分享~
- 2301_768073662023-09-19资源值得借鉴的内容很多,那就浅学一下吧,值得下载!onnx2024-03-07嗯嗯,还有问题,请私信联系,我会帮你解答!
onnx
- 粉丝: 9685
- 资源: 5598
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功