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
# load READY.DAT (56 cols) | |
from dataload import load_object | |
x_train, x_test, y_train, y_test = load_object('ready.dat') | |
x_train.max(axis=0) | |
del x_test, y_test # we don't need the test set for now | |
# under-sample the big classes to make the set manageable | |
from imblearn.under_sampling import RandomUnderSampler | |
rus = RandomUnderSampler(ratio={'normal':50000, 'dos':50000}, random_state=4129) | |
x_train, y_train = rus.fit_sample(x_train, y_train.attack_type) |