This is my hyper parameter.top_words = 5000
maxlen = 400
batch_size = 32
embedding_dims = 50
filters = 250
kernel_size = 3
hidden_dims = 250
epochs = 1
This is my shape of my dataframe.print(x_train.shape)
print(y_train.shape)
print(x_test.shape)
print(y_test.shape)
(4681, 2)
(4681,)
(1171, 2)
(1171,)
This is my Model.model = Sequential()
model.add(Embedding(top_words, embedding_dims, input_length=maxlen))
model.add(Dropout(0.2))
model.add(Conv1D(filters, kernel_size, padding='valid', activation='relu', strides=1))
model.add(GlobalMaxPooling1D())
model.add(Dense(hidden_dims))
model.add(Dropout(0.2))
model.add(Activation('relu'))
model.add(Dense(1))
model.add(Activation('sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
model.fit(x_train, y_train, batch_size=batch_size, epochs=ep, validation_data=(x_test, y_test))
scores = model.evaluate(x_train, y_train, batch_size=batch_size,verbose=1)
My Error isValueError: Input arrays should have the same number of samples as target arrays. Found 2 input samples and 4681 target samples.
Kindly give a valuable suggestion, to rectify the error.