I have a multilabel classification problem, I used the following code but the validation accuracy jumps to 99% in the first epochs. my whole input is 1245x1024, so each line means one spectrum (so there are 1245 spectrum examples). So one spectrum is (1x1024). The output are my labels. i have 245 different classes(here elements). One spectrum contains one ore two elements. one output for one prediction is (1x245)
x = pd.read_csv('spectrum_max2proSpund245.csv')
y1 = pd.read_csv('nuclides_max2proSpund245.csv', delimiter=';')
num_features = 1024
model = Sequential()
model.add(Dense(230, kernel_initializer='normal', input_shape=(num_features,),
activation='tanh'))
model.add(Dropout(0.25))
model.add(Dense(245, kernel_initializer='normal', activation='sigmoid'))
model.summary()
X_train, X_test, y_train, y_test = train_test_split(x, y, random_state=42, test_size=0.2)
thats how i complile my model
model.compile(loss='binary_crossentropy',optimizer='Adam',metrics=['accuracy'])
and thats how i fit and evaluate
model.fit(X_train, y_train, epochs=20, validation_data=(X_test, y_test), batch_size=60)
model.evaluate(X_test, y_test, batch_size=60)
model evaluating and model fit have the same results, but when i look manually in my prediction there are maybe only 19% of the predictions correct. what is wrong in my code?