# I can't understand why the validation and training loss almost constant and not converging?

df = df_1.iloc[0:200000, :]

# Train-Test Split (keeping all columns)
train, test = df.loc[df['index'] <= 160000], df.loc[df['index'] > 160000]

# Create a StandardScaler object and fit on the first 21 columns of the training data
scaler = StandardScaler()
scaler = scaler.fit(train.iloc[:, 0:21])

# Transform the first 21 columns of both training and test data
train.iloc[:, :21] = scaler.transform(train.iloc[:, :21])

test.iloc[:, :21] = scaler.transform(test.iloc[:, :21])

#print(train.iloc[:,:21])

seq_size = 3
def to_sequences(x, y, seq_size):
x_values = []
y_values = []

for i in range(len(x) - seq_size):
x_values.append(x.iloc[i:(i + seq_size), :21].values)

y_values.append(x.iloc[(i + seq_size), :21].values)

return np.array(x_values), np.array(y_values)

trainX, trainY = to_sequences(train[["Fp1", "Fp2", "F3", "F4", "F7", "F8", "Fz", "C3", "C4", "Cz", "T3", "T5", "T4", "T6", "P3", "P4", "Pz", "O1", "O2", "ECG", "Resp"]], train['y'], seq_size)

testX, testY = to_sequences(test[["Fp1", "Fp2", "F3", "F4", "F7", "F8", "Fz", "C3", "C4", "Cz", "T3", "T5", "T4", "T6", "P3", "P4", "Pz", "O1", "O2", "ECG", "Resp"]], test['y'], seq_size)

model = Sequential()