I have sample data with 6 columns and 100 rows (all values are integers). there are 20 classes that the input data is classified into. This is the model that I tried building:
model = Sequential()
model.add(Dense(50,input_shape=X.shape[1:],activation='relu'))
model.add(Dense(20,activation='softmax'))
model.compile(loss='categorical_crossentropy', optimizer='rmsprop',
metrics=['accuracy'])
model.summary()
model.fit(X, Y, epochs=1000, verbose=0)
predictions=model.predict(test_data)
However, I get an error:
Error when checking target: expected dense_2 to have shape (20,) but got array with shape (1,)
I have two questions:
- What am I doing wrong?
- Can you give me a proper architecture for this?