This is the code that I have used. Now I do not really know where did I go wrong as I am new to such things. As an overview of what I am trying to do is that I am trying to classify where there is an attack or no. I gave ‘Y’ as my […]
- Tags (x_test.shape[0], ) model = Sequential() model.add(LSTM(200, 0:115] x.shape Y=data['Y'] Y #scaling from sklearn.preprocessing import StandardScaler scaler = StandardScaler() scaler.fit(x) X= scaler.tra, 1, 115, 275840] this is a snapshot of the error The output, acc = model.evaluate(X_test, activation='relu', activation='softmax')) from keras.optimizers import SGD model.compile(loss = 'sparse_categorical_crossentropy', batch_size=2000, beta_1=0.9, beta_2=0.999, Dropout from tensorflow.keras.layers import Embedding from tensorflow.keras.layers import LSTM tf.keras.backend.clear_session() from tensorfl, epochs = 5, epsilon=1e-07, f1_score #label encoder data['Y'].unique() from sklearn import preprocessing label_encoder = preprocessing.LabelEncoder() data['Y']=label, input_shape[1]), it goes very well until evaluating the output be as followed: > 0.8152588605880737 0.36209338903427124 -------------------------------------, metrics = ['accuracy']) model.summary() history = model.fit(x_train, optimizer = opt, precision_score, random_state=44, recall_score, return_sequences=True)) model.add(Dropout(0.2)) model.add(Dense(11, shuffle =True) #reshape x_train = np.reshape(x_train, test_size=0.33, This is the code that I have used. Now I do not really know where did I go wrong as I am new to such things. As an overview of what I am tryi, validation_data= (X_test, x_test, X_train.shape[0], X.shape[1])) import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.layers import Dense, X.shape[1])) x_test = np.reshape(x_test, y, y_pred.round()) 9 print('Confusion Matrix\n') 2 frames /usr/local/lib/python3.7/dist-packages/sklearn/utils/validation.py in check_con, y_pred.round()) print('Confusion Matrix\n') print(confusionts) sn.heatmap(confusiontr) When i do run it, y_pred) 8 confusionts = confusion_matrix(y_test, y_pred) confusionts = confusion_matrix(y_test, y_test = train_test_split(x, y_test) print(acc) print(score) y_pred = model.predict(x_test) y_predtrain = model.predict(x_train) (* here where I get the error) from skl, y_test)) score, y_train