Classification of network attack data (attack or no attack)

Asked

Viewed 156 times

1

I’m using the dataset:

https://www.unsw.adfa.edu.au/unsw-canberra-cyber/cybersecurity/ADFA-NB15-Datasets/

The goal is to classify a sample as attack or no attack. A good idea would be to use logistic regression?

I made the code below to make pairplots in the dataset. The problem is that the dataset has 49 columns and I would like to filter the columns to use in the pairplot, I tried to make a Slice in the UNSW11 variable, like UNSW11[:,1:5], inside the pairplot but got error: "builtins.Typeerror: unhashable type: 'Slice'

Is there any way to limit the number of columns to enter the pairplot?

 # -*- coding: utf-8 -*-
    import pandas as pd
    import numpy as np
    import matplotlib.pyplot as plt
    import seaborn as sns
    UNSW11 = pd.read_csv('/home/govinda/Desktop/UNSW-NB15_1_ed.csv')
    sns.pairplot(UNSW11,palette='bwr',hue = 'class') #usar hue!
    plt.show()

1 answer

2


I did a test with the base you pointed out and managed to select the columns of the pairplot with the vars parameter :

sns.pairplot(df,palette='bwr',hue="var45", vars=["var8", "var9","var41"]) plt.show()

whereas var8,var9,var41 and var45 are respectively columns 8,9,41 and 45 of their dataset

This was my resulting Plot

inserir a descrição da imagem aqui

  • How you named the columns?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.