title: ValueError: Supported target types are: ('binary', 'multiclass'). Got 'continuous-multioutput' instead
body: <p>I want to do KFold cross-validation on my CNN model in Keras as shown below:</p>
  
  <pre><code>X = df.iloc[:,0:10165]  
  X = X.to_numpy()                    
  X = X.reshape([X.shape[0], X.shape[1], 1])
  X_train_1 = X[:,0:10080,:].reshape(921,10080)          
  X_train_2 = X[:,10080:10165,:].reshape(921,85)      
  Y = df.iloc[:,10168:10170]
  
  num_classes = 2
  
  cvscores = [] 
  for train, test in kfold.split(X_train_1,X_train_2, Y):
  
      inputs_1 = keras.Input(shape=(10080,1))
      layer1 = Conv1D(64,14)(inputs_1)
      layer2 = layers.MaxPool1D(5)(layer1)
      layer3 = Conv1D(64, 14)(layer2)       
      layer4 = layers.GlobalMaxPooling1D()(layer3)
  
      inputs_2 = keras.Input(shape=(85,))
      layer5 = layers.concatenate([layer4, inputs_2])
      layer6 = Dense(128, activation='relu')(layer5)
      layer7 = Dense(2, activation='softmax')(layer6)
  
      model_2 = keras.models.Model(inputs = [inputs_1, inputs_2], output = [layer7])
      model_2.summary()   
  
      adam = keras.optimizers.Adam(lr = 0.0001)
      model_2.compile(loss = 'categorical_crossentropy', optimizer = 'adam', metrics = ['acc'])
  
      history = model_2.fit([X_train_1,X_train_2][train], Y[train], epochs = 120, batch_size = 256, callbacks = [keras.callbacks.EarlyStopping(monitor='val_loss', patience=50)])
  
  
      scores = model.evaluate([X_train_1,X_train_2][test], Y[test], verbose=0)   
      print("%s: %.2f%%" % (model.metrics_names[1], scores[1]*100)) 
      cvscores.append(scores[1] * 100)
  
  print("%.2f%% (+/- %.2f%%)" % (np.mean(cvscores), np.std(cvscores)))          
  </code></pre>
  
  <p>But I incurred error </p>
  
  <pre><code>---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-20-20af389637bd&gt; in &lt;module&gt;()
       11 
       12 cvscores = []
  ---&gt; 13 for train, test in kfold.split(X_train_1,X_train_2, Y):
       14 
       15     inputs_1 = keras.Input(shape=(10080,1))
  
  3 frames
  /usr/local/lib/python3.6/dist-packages/sklearn/model_selection/_split.py in _make_test_folds(self, X, y)
      639             raise ValueError(
      640                 'Supported target types are: {}. Got {!r} instead.'.format(
  --&gt; 641                     allowed_target_types, type_of_target_y))
      642 
      643         y = column_or_1d(y)
  
  ValueError: Supported target types are: ('binary', 'multiclass'). Got 'continuous-multioutput' instead.
  </code></pre>
  
  <p>From <a href="https://github.com/keras-team/keras/blob/master/examples/mnist_mlp.py" rel="nofollow noreferrer">this post</a> and <a href="https://stackoverflow.com/questions/58585227/why-am-i-getting-supported-target-types-are-binary-multiclass-got-con">this question</a> I realised that I might have to convert <code>Y</code> to <code>binary</code> so I added <code>Y = keras.utils.to_categorical(Y, num_classes)</code> where <code>num_classes</code> is 2, but this didn't work. </p>
  
  <p>What could be the problem? Thanks</p>
  
  <hr>
  
  <p>Edit</p>
  
  <p>The data looks something like this, with last 2 columns as <code>Y</code>(labels). </p>
  
  <pre><code>id    x0  x1    x2   x3   x4   x5  ... x10079   mean var ... Y0     Y1
  1    40  31.05 25.5 25.5 25.5 25   ...  33       24   1       1      0
  2    35  35.75 36.5 26.5 36.5 36.5 ...  29       31   2       0      1 
  3    35  35.70 36.5 36.5 36.5 36.5 ...  29       25   1       1      0 
  4    40  31.50 23.5 24.5 26.5 25   ...  33       29   3       0      1
   ... 
  921  40  31.05 25.5 25.5 25.5 25   ...  23       33   2       0      1
  </code></pre>