I did ANN classification using SMOTE random sampling in python but I found strange plot loss and accuracy results. This is my code:
#With SMOTE
sm = SMOTE(random_state=42)
Train_X2_Smote, Train_Y2_Smote = sm.fit_resample(Train_X2_Tfidf, Train_Y2)
#TRIAL 4
def reset_seeds():
np.random.seed(0)
python_random.seed(0)
tf.random.set_seed(0)
reset_seeds()
model4 = Sequential()
model4.add(Dense(10, input_dim= Train_X2_Smote.shape[1], activation='sigmoid'))
model4.add(Dense(1, activation='sigmoid'))
opt = Adam (learning_rate=0.001)
model4.compile(loss='binary_crossentropy', optimizer=opt, metrics=['accuracy'])
model4.summary()
es = EarlyStopping(monitor="val_loss",mode='min',patience=10)
history4 = model4.fit(Train_X2_Smote, Train_Y2_Smote, epochs=1000, verbose=1,
validation_split=0.2, batch_size=32, callbacks =[es])
resulting loss and accuracy graph:
is there anything have to fix in my code?