November 2019
Intermediate to advanced
346 pages
9h 36m
English
In the following steps, we will train a random forest classifier to detect DDoS traffic:
import pandas as pdfeatures = [ "Fwd Seg Size Min", "Init Bwd Win Byts", "Init Fwd Win Byts", "Fwd Seg Size Min", "Fwd Pkt Len Mean", "Fwd Seg Size Avg", "Label", "Timestamp",]dtypes = { "Fwd Pkt Len Mean": "float", "Fwd Seg Size Avg": "float", "Init Fwd Win Byts": "int", "Init Bwd Win Byts": "int", "Fwd Seg Size Min": "int", "Label": "str",}date_columns = ["Timestamp"]
df = pd.read_csv("ddos_dataset.csv", usecols=features, dtype=dtypes,parse_dates=date_columns,index_col=None)