Answers.Body: <p>This depend on type of data you use. </p>
  
  <h2>Time sequence data</h2>
  
  <p>If the data advanced in time, a LSTM or similar RNN should be used. RNN calculate output through time. It works very good on time series data as it have a real sense of time. While CNN and MLP could work for time series data, it often don't work that well as different timestep of data is not defined. </p>
  
  <h2>Non- Time sequence data</h2>
  
  <p>According to you previous comment, the data seems to be of this kind. In the case of your data, a normal Multi-layer perceptron works well for this. The data is a direct mapping between the input and the output. If the input data is an image, use a CNN. </p>
  
  <p>For example code in keras, see here:
  You need the <code>pandas</code> module for this to work. Run <code>pip install pandas</code> to install pandas.
      from keras.models import Sequential
      from keras.utils import np_utils
      from keras.layers.core import Dense, Activation, Dropout</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  # Read data
  train = pd.read_csv('../input/train.csv')
  labels = train.ix[:,0].values.astype('int32')
  X_train = (train.ix[:,1:].values).astype('float32')
  X_test = (pd.read_csv('../input/test.csv').values).astype('float32')
  
  # convert list of labels to binary class matrix
  y_train = np_utils.to_categorical(labels) 
  
  # pre-processing: divide by max and substract mean
  scale = np.max(X_train)
  X_train /= scale
  X_test /= scale
  
  mean = np.std(X_train)
  X_train -= mean
  X_test -= mean
  
  input_dim = X_train.shape[1]
  nb_classes = y_train.shape[1]
  
  # Here's a Deep Dumb MLP (DDMLP)
  model = Sequential()
  model.add(Dense(128, input_dim=input_dim))
  model.add(Activation('relu'))
  model.add(Dropout(0.15))
  model.add(Dense(128))
  model.add(Activation('relu'))
  model.add(Dropout(0.15))
  model.add(Dense(nb_classes))
  model.add(Activation('softmax'))
  
  # we'll use categorical xent for the loss, and RMSprop as the optimizer
  model.compile(loss='categorical_crossentropy', optimizer='rmsprop')
  
  print("Training...")
  model.fit(X_train, y_train, nb_epoch=10, batch_size=16, validation_split=0.1, show_accuracy=True, verbose=2)
  
  print("Generating test predictions...")
  preds = model.predict_classes(X_test, verbose=0)
  
  def write_preds(preds, fname):
      pd.DataFrame({"ImageId": list(range(1,len(preds)+1)), "Label": preds}).to_csv(fname, index=False, header=True)
  
  write_preds(preds, "keras-mlp.csv")
  </code></pre>
  
  <p>Code source: <a href="https://www.kaggle.com/fchollet/simple-deep-mlp-with-keras" rel="nofollow noreferrer">https://www.kaggle.com/fchollet/simple-deep-mlp-with-keras</a></p>
  
  <p>In conclusion, in the case of our data, use a multi layer perceptron  should work. Hope kit can help you and have a nice day!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-04T01:02:17.097Z
Answers.Text: Many thanks..MLP fits my requirement. Would appreciate if you could share any example implementation using Keras if possible....
Answers.UserDisplayName: Riz
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-04T05:00:17.927Z
Answers.Text: Edited the answer to include example code. Hope it can help you.
Answers.UserDisplayName: Clement
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-30T23:45:57.367Z
Answers.LastActivityDate: 2019-11-04T04:59:54.633Z
Answers.LastEditDate: 2019-11-04T04:59:54.633Z
Answers.UserDisplayName: Clement
Body: <p>Which model is the most appropriate for this problem with multiple inputs and outputs?</p>
  
  <p>The data set is</p>
  
  <pre><code>A1, A2, A3, A4, A5, A6, B1, B2, B3, B4
  </code></pre>
  
  <p>where <code>A1, A2, A3, A4, A5, A6</code> are the inputs and <code>B1, B2, B3, B4</code> the outputs (this is what I want the model to predict).</p>
  
  <p>What an LSTM be appropriate for this task? Any advice or hint would be much appreciated. Also if anyone can share already done examples, it would really help me a lot.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-28T18:18:11.393Z
Comments.Text: Can you please mention what is the nature of your data? In really depends on the types of your inputs and outputs. LSTM works better usually when you are dealing with sequential data or data with temporal relationship.
Comments.UserDisplayName: aminrd
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-29T20:53:24.690Z
Comments.Text: Thanks for your comments....It is basically electrical load/energy consumption dataset containing mainly:
  
  Equipment Details(Eg: type of equipment, AC, Fridge, etc)
  
  Electrical Load Detail (eg: Power, Voltage, Current, Watts, Heat dissipation ..etc)
  
  Output data: Power, Current, Voltage etc prediction using the availale dataset...
  As you can see for this dataset sequence doesnt matter. Currently the data is being calculated using different electrical power equations depending on type of equipment...So time stamping or sequence is not important..
Comments.UserDisplayName: Riz
Tags: <ai-design><tensorflow><keras><prediction>
Title: Which model can I use for this problem with multiple inputs and outputs?
UserDisplayName: Riz
ThreadText: # Which model can I use for this problem with multiple inputs and outputs?
  
  (Asked by: username_0 on 2019-10-28)
  
  Which model is the most appropriate for this problem with multiple inputs and outputs?
  The data set is
  A1, A2, A3, A4, A5, A6, B1, B2, B3, B4
  
  where A1, A2, A3, A4, A5, A6 are the inputs and B1, B2, B3, B4 the outputs (this is what I want the model to predict).
  What an LSTM be appropriate for this task? Any advice or hint would be much appreciated. Also if anyone can share already done examples, it would really help me a lot.
  
  **Tags:** ai-design, tensorflow, keras, prediction
  > **Comments:**
  > **username_1**: Can you please mention what is the nature of your data? In really depends on the types of your inputs and outputs. LSTM works better usually when you are dealing with sequential data or data with temporal relationship.  
  > **username_0**: Thanks for your comments....It is basically electrical load/energy consumption dataset containing mainly:  Equipment Details(Eg: type of equipment, AC, Fridge, etc)  Electrical Load Detail (eg: Power, Voltage, Current, Watts, Heat dissipation ..etc)  Output data: Power, Current, Voltage etc prediction using the availale dataset... As you can see for this dataset sequence doesnt matter. Currently the data is being calculated using different electrical power equations depending on type of equipment...So time stamping or sequence is not important..  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-10-30. Score: 1
  
  This depend on type of data you use. 
  Time sequence data
  If the data advanced in time, a LSTM or similar RNN should be used. RNN calculate output through time. It works very good on time series data as it have a real sense of time. While CNN and MLP could work for time series data, it often don't work that well as different timestep of data is not defined. 
  Non- Time sequence data
  According to you previous comment, the data seems to be of this kind. In the case of your data, a normal Multi-layer perceptron works well for this. The data is a direct mapping between the input and the output. If the input data is an image, use a CNN. 
  For example code in keras, see here:
  You need the pandas module for this to work. Run pip install pandas to install pandas.
      from keras.models import Sequential
      from keras.utils import np_utils
      from keras.layers.core import Dense, Activation, Dropout
  import pandas as pd
  import numpy as np
  
  # Read data
  train = pd.read_csv('../input/train.csv')
  labels = train.ix[:,0].values.astype('int32')
  X_train = (train.ix[:,1:].values).astype('float32')
  X_test = (pd.read_csv('../input/test.csv').values).astype('float32')
  
  # convert list of labels to binary class matrix
  y_train = np_utils.to_categorical(labels) 
  
  # pre-processing: divide by max and substract mean
  scale = np.max(X_train)
  X_train /= scale
  X_test /= scale
  
  mean = np.std(X_train)
  X_train -= mean
  X_test -= mean
  
  input_dim = X_train.shape[1]
  nb_classes = y_train.shape[1]
  
  # Here's a Deep Dumb MLP (DDMLP)
  model = Sequential()
  model.add(Dense(128, input_dim=input_dim))
  model.add(Activation('relu'))
  model.add(Dropout(0.15))
  model.add(Dense(128))
  model.add(Activation('relu'))
  model.add(Dropout(0.15))
  model.add(Dense(nb_classes))
  model.add(Activation('softmax'))
  
  # we'll use categorical xent for the loss, and RMSprop as the optimizer
  model.compile(loss='categorical_crossentropy', optimizer='rmsprop')
  
  print("Training...")
  model.fit(X_train, y_train, nb_epoch=10, batch_size=16, validation_split=0.1, show_accuracy=True, verbose=2)
  
  print("Generating test predictions...")
  preds = model.predict_classes(X_test, verbose=0)
  
  def write_preds(preds, fname):
      pd.DataFrame({"ImageId": list(range(1,len(preds)+1)), "Label": preds}).to_csv(fname, index=False, header=True)
  
  write_preds(preds, "keras-mlp.csv")
  
  Code source: https://www.kaggle.com/fchollet/simple-deep-mlp-with-keras
  In conclusion, in the case of our data, use a multi layer perceptron  should work. Hope kit can help you and have a nice day!
  
  > **Comments:**
  > **username_0**: Many thanks..MLP fits my requirement. Would appreciate if you could share any example implementation using Keras if possible....  
  > **username_2**: Edited the answer to include example code. Hope it can help you.  
  
  ---
  
  