python图片自动校正流量_python网络流量异常检测

import tensorflow as tf

from sklearn.model_selection import train_test_split

from tensorflow.keras.models import Sequential

import numpy,time

from collections import Counter

from tensorflow.keras import layers

from sklearn.metrics import confusion_matrix

from sklearn.svm import SVC

from sklearn.naive_bayes import GaussianNB

from sklearn.neighbors import KNeighborsClassifier

from sklearn.tree import DecisionTreeClassifier

from sklearn import metrics

import matplotlib.pyplot as plt

def handleProtocol(input):

protocol_list=['tcp','udp','icmp']

if input in protocol_list:

return protocol_list.index(input)

def handleService(input):

service_list=['aol','auth','bgp','courier','csnet_ns','ctf','daytime','discard','domain','domain_u',

'echo','eco_i','ecr_i','efs','exec','finger','ftp','ftp_data','gopher','harvest','hostnames',

'http','http_2784','http_443','http_8001','imap4','IRC','iso_tsap','klogin','kshell','ldap',

'link','login','mtp','name','netbios_dgm','netbios_ns','netbios_ssn','netstat','nnsp','nntp',

'ntp_u','other','pm_dump','pop_2','pop_3','printer','private','red_i','remote_job','rje','shell',

'smtp','sql_net','ssh','sunrpc','supdup','systat','telnet','tftp_u','tim_i','time','urh_i','urp_i',

'uucp','uucp_path','vmnet','whois','X11','Z39_50']

if input in service_list:

return service_list.index(input)

def handleFlag(input):

flag_list=['OTH','REJ','RSTO','RSTOS0','RSTR','S0','S1','S2','S3','SF','SH']

if input in flag_list:

return flag_list.index(input)

def handleLabel(input):

#多了一个’udpstorm标签(5分类,2分类)

try:

label_dict ={'normal':0}

dos = dict(zip(['back','neptune','

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值