I am new on classification problems using artificial neural networks
I have a classification problem where the input data are 8 columns with decimal values Which are measures and the output data are 8 columns with integer values which are objects
INPUTS
785.39 6.30 782.75 771.82 7.53 -94.86 378.66 771.82
.
.
.
OUTPUTS
8 9 5 7 3 1 6 2
.
.
.
The records for the training data are 800 and for the test data are 200
This is the code
import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.utils import np_utils
seed = 7
numpy.random.seed(seed)
datasetTrain = numpy.loadtxt("train.csv", delimiter=",")
datasetTest = numpy.loadtxt("test.csv", delimiter=",")
X_train = datasetTrain[:,0:7]
y_train = datasetTrain[:,8:15]
X_test = datasetTest[:,0:7]
y_test = datasetTest[:,8:15]
y_train = np_utils.to_categorical(y_train)
y_test = np_utils.to_categorical(y_test)
def baseline_model():
# create model
model = Sequential()
model.add(Dense(7, input_dim=7, kernel_initializer='normal', activation='relu'))
model.add(Dense((5593, 785), kernel_initializer='normal', activation='softmax'))
# Compile model
model.compile(loss='categorical_crossentropy', optimizer='adam')
return model
model = baseline_model()
model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=400,
batch_size=200, verbose=25)
scores = model.evaluate(X_test, y_test, verbose=0)
print("Baseline Error: %.2f%%" % (100-scores[1]*100))
I get this error
Traceback (most recent call last):
File "proyecto.py", line 29, in <module>
model = baseline_model()
File "proyecto.py", line 24, in baseline_model
model.add(Dense((5593, 785), kernel_initializer='normal', activation='softmax'))
ValueError: setting an array element with a sequence.
Which is the best model for this data?