title: MultiOutputClassifier ValueError: The number of classes has to be greater than one
body: <p>I am solving a multilabel classification task using SVM with data representing features of processed images in X and the presence of 6 natural elements (like hills, clouds, etc) represented by binary variables(0 if absent/1 if present), present in Y. Here's the train and the test data:</p>
  <p>Train: <a href="https://s3.amazonaws.com/istreet-questions-us-east-1/418844/train.csv" rel="nofollow noreferrer">https://s3.amazonaws.com/istreet-questions-us-east-1/418844/train.csv</a><br />
  Test: <a href="https://s3.amazonaws.com/istreet-questions-us-east-1/418844/test.csv" rel="nofollow noreferrer">https://s3.amazonaws.com/istreet-questions-us-east-1/418844/test.csv</a></p>
  <p>Number of features: 294
  Number of labels for each instance: 6</p>
  <p>This is the code I am using to train my model:</p>
  <pre><code>import csv
  import numpy as np
  
  train = []
  test = []
  
  with open('/home/keerat/Desktop/train.csv') as trainfile:
      reader = csv.reader(trainfile)
      for row in reader:
          train.append(row)
  
  with open('/home/keerat/Desktop/test.csv') as testfile:
      reader = csv.reader(testfile)
      for row in reader:
          test.append(row)
  
  X = []
  y = []
  X_test = []
  # split data into X and y
  for i in range(len(train)):
      X.append(train[i][0:294])
      y.append(train[i][294:300])
  for i in range(len(test)):
      X_test.append(test[i][0:294])
  
  # convert list of strings to list of num
  for i in range(len(X)):
      X[i] = [float(x) for x in X[i]]
  for j in range(len(y)):
      y[j] = [int(yy) for yy in y[i]]
  for i in range(len(X_test)):
      X_test[i] = [float(x) for x in X_test[i]]
  
  X = np.array(X)
  y = np.array(y)
  X_test = np.array(X_test)
  # define svm model for multi label classification
  from sklearn.svm import SVC
  from sklearn import metrics
  from sklearn.multioutput import MultiOutputClassifier
  svc=SVC() #Default hyperparameters
  n_samples, n_features = X.shape
  n_outputs = y.shape[1]
  multi_target_svc = MultiOutputClassifier(svc, n_jobs=-1)
  multi_target_svc.fit(X[:],y)
  </code></pre>
  <p>Here's how X and y look like:</p>
  <pre><code>X:
  [[0.826575 0.843082 0.805944 ... 0.010919 0.011375 0.015069]
   [0.766867 0.669694 0.636238 ... 0.055661 0.079765 0.097522]
   [0.962784 0.975387 0.96395  ... 0.195177 0.221791 0.201402]
   ...
   [0.527828 0.588172 0.639713 ... 0.030422 0.004995 0.002626]
   [0.574357 0.598345 0.63484  ... 0.039915 0.075365 0.056335]
   [0.698135 0.732643 0.724918 ... 0.014463 0.04427  0.041442]]
  y: 
  [[1 0 0 0 0 1]
   [1 0 0 0 0 1]
   [1 0 0 0 0 1]
   ...
   [1 0 0 0 0 1]
   [1 0 0 0 0 1]
   [1 0 0 0 0 1]]
  </code></pre>
  <p>The model.fit() line throws the error mentioned in the main heading. I have already checked <code>numpy.unique(y)--&gt;[0 1]</code>which means I have more than 1 (2 precisely) class available.</p>
  <p>Could anyone pls give some insight into what's going wrong here?</p>