0
$\begingroup$

I have some questions about the sequential model from Keras. Please let me know if there is anything wrong with how I presented my questions and I will be more than happy to fix it to make it align with community guidelines.

I am working with a data set of about 6000 points. I have three input variables (all real numbers) and I have one output (also a real number). It is essentially a regression problem.

  1. I found here that the sequential model is not a good idea to use if you have multiple inputs. Is this true? I also found many examples of people using this network for multiple input values so I'm confused.
  2. My three data inputs represent three different parameters for a structure design. This is considered sequential data is that correct?

The current code I have is giving me rather good $R^2$ values (~.85) so I am wondering if this is a fluke or if what I have done is valid even though I have a multi-dimensional input.

This is more of a conceptual question but in case it helps, here is the code I wrote:

model = Sequential()
model.add(Dense(3, input_shape=(3,), activation='relu')) 
model.add(Dense(13, activation='relu'))#hiddn layer 1
model.add(Dense(9, activation='relu'))#hidden layer 2
model.add(Dense(9, activation='relu'))#hidden layer 3
model.add(Dense(9, activation='relu'))#hidden layer 4 
model.add(Dense(1,)) 
model.compile(Adam(learning_rate = 0.001), 'mean_squared_error')
earlystopper = EarlyStopping(monitor='val_loss', min_delta=0, patience=15, verbose=1, mode='auto')
model.fit(X_trainL, y_trainL, epochs = 5000, validation_split = 0.1,shuffle = True, verbose = 0,callbacks=[earlystopper])
$\endgroup$

1 Answer 1

0
$\begingroup$

Sequential model when it says you cant have multiple inputs its basically does not refer to your case were you have single input of 3 dimension. The examples of multiple inputs and multiple output are as follows :

  1. Training a model to generate image caption requires both image and text data during training which is multiple inputs

No, the three variables you have is not a sequential data as API refers it.

R2 values may be accurate but rely on it if it is calaculate on test data only

$\endgroup$
1
  • $\begingroup$ thank you very much! This was a very helpful response. So if my data is not sequential is it ok to still use this approach? $\endgroup$ Feb 7, 2022 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.