Created
May 30, 2024 03:27
-
-
Save jgoodie/fecfa11aa7c2f211c26b530d79c7fade to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
np.random.seed(42) | |
df = pd.read_csv("data/RT_IOT2022.csv") | |
s = ['DOS_SYN_Hping', 'Thing_Speak', 'ARP_poisioning', 'MQTT_Publish'] | |
s_dict = {'DOS_SYN_Hping':0, 'Thing_Speak':1, 'ARP_poisioning':2, 'MQTT_Publish':3} | |
df = df[df.Attack_type.isin(s)] | |
df.drop("Unnamed: 0", axis=1, inplace=True) | |
df.drop("service", axis=1, inplace=True) | |
df.drop("proto", axis=1, inplace=True) | |
# df = pd.get_dummies(df, columns=['service', 'proto'])*1 | |
df["label"] = df.Attack_type.apply(lambda x: s_dict[x]) | |
df.drop("Attack_type", axis=1, inplace=True) | |
df = df.sample(frac=1) | |
df.shape |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment