text_html_output_1.png
from sklearn import preprocessing

from sklearn.preprocessing import OneHotEncoder

X_train = df_train.drop('xAttack', axis=1)
Y_train = df_train.loc[:, ['xAttack']]
X_test = df_test.drop('xAttack', axis=1)
Y_test = df_test.loc[:, ['xAttack']]

le = preprocessing.LabelEncoder()
enc = OneHotEncoder()
lb = preprocessing.LabelBinarizer()

X_train['protocol_type'] = le.fit_transform(X_train['protocol_type'])
X_test['protocol_type'] = le.fit_transform(X_test['protocol_type'])

Y_train['xAttack'] = le.fit_transform(Y_train['xAttack'])
lb.fit_transform(Y_train['xAttack'])
Y_test['xAttack'] = le.fit_transform(Y_test['xAttack'])
lb.fit_transform(Y_test['xAttack'])
Y_train.describe()