text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

training_set = pd.read_parquet('/kaggle/input/unswnb15/UNSW_NB15_training-set.parquet')
testing_set = pd.read_parquet('/kaggle/input/unswnb15/UNSW_NB15_testing-set.parquet')

training_set.dtypes

training_set.attack_cat.value_counts()

training_set.dtypes

target = 'label'
features = list(training_set.columns.difference([target]).values)

training_set.drop(columns=['attack_cat'], inplace=True)
testing_set.drop(columns=['attack_cat'], inplace=True)

training_set.isna().sum()

cat_cols = [col for col in training_set.columns if training_set[col].dtype == 'category']
cat_cols

fig = plt.figure(figsize=(25, 70))
for i, col in enumerate(training_set.columns):
    plt.subplot(15, 4, i + 1)
    sns.histplot(training_set, x=col, stat='percent', hue='label', bins=100, log_scale=(False, False))
fig.tight_layout()
plt.show()