title: Receiving Classification metrics can't handle a mix of multiclass confusion_matrix
body: <p>after I cross-validated my training datasets - I began to have trouble with the confusion matrix. my X_Train shape shows (835, 5) and my y_train shape shows (835,). I cannot use this method when my data is mixed. Otherwise, the modules before it, were working perfectly. The code that I have is written below. How do I setup the training data to work with the confusion_matrix method?</p>
  
  <p>cross_validate/cross_val_score module</p>
  
  <pre><code>from sklearn.model_selection import cross_validate
  from sklearn.model_selection import cross_val_score
  lasso = linear_model.Lasso()
  cross_validate_results = cross_validate(lasso, X_train, y_train, return_train_score=True)
  sorted(cross_validate_results.keys())
  cross_validate_results['test_score']
  print(cross_val_score(lasso, X_train, y_train))
  </code></pre>
  
  <p>confusion_matrix module</p>
  
  <pre><code>from sklearn.metrics import confusion_matrix
  
  confusion_matrix(y_train, X_train)
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-83-78f76b6bc798&gt; in &lt;module&gt;()
        1 from sklearn.metrics import confusion_matrix
        2 
  ----&gt; 3 confusion_matrix(y_test, X_test)
  
  ~\Anaconda3\lib\site-packages\sklearn\metrics\classification.py in confusion_matrix(y_true, y_pred, labels, sample_weight)
      248 
      249     """
  --&gt; 250     y_type, y_true, y_pred = _check_targets(y_true, y_pred)
      251     if y_type not in ("binary", "multiclass"):
      252         raise ValueError("%s is not supported" % y_type)
  
  ~\Anaconda3\lib\site-packages\sklearn\metrics\classification.py in _check_targets(y_true, y_pred)
       79     if len(y_type) &gt; 1:
       80         raise ValueError("Classification metrics can't handle a mix of {0} "
  ---&gt; 81                          "and {1} targets".format(type_true, type_pred))
       82 
       83     # We can't have more than one value on y_type =&gt; The set is no more needed
  
  ValueError: Classification metrics can't handle a mix of multiclass and multiclass-multioutput targets
  </code></pre>
  
  <p>print shape of arrays module</p>
  
  <pre><code>print(X_train.shape)
  print(y_train.shape)
  (835, 5)
  (835,)
  </code></pre>
  
  <p>UPDATE:
  I am now receiving this error <code>ValueError: Found input variables with inconsistent numbers of samples: [356, 209]</code></p>
  
  <p>When I run confusion_matrix(y_train, X_train)</p>
  
  <pre><code>from sklearn.metrics import confusion_matrix
  
  confusion_matrix(y_train, y_pred)
  </code></pre>
  
  <p>Full error</p>
  
  <pre><code>---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-46-3caf00cb052f&gt; in &lt;module&gt;()
        1 from sklearn.metrics import confusion_matrix
        2 
  ----&gt; 3 confusion_matrix(y_train, y_pred)
  
  ~\Anaconda3\lib\site-packages\sklearn\metrics\classification.py in confusion_matrix(y_true, y_pred, labels, sample_weight)
      248 
      249     """
  --&gt; 250     y_type, y_true, y_pred = _check_targets(y_true, y_pred)
      251     if y_type not in ("binary", "multiclass"):
      252         raise ValueError("%s is not supported" % y_type)
  
  ~\Anaconda3\lib\site-packages\sklearn\metrics\classification.py in _check_targets(y_true, y_pred)
       69     y_pred : array or indicator matrix
       70     """
  ---&gt; 71     check_consistent_length(y_true, y_pred)
       72     type_true = type_of_target(y_true)
       73     type_pred = type_of_target(y_pred)
  
  ~\Anaconda3\lib\site-packages\sklearn\utils\validation.py in check_consistent_length(*arrays)
      202     if len(uniques) &gt; 1:
      203         raise ValueError("Found input variables with inconsistent numbers of"
  --&gt; 204                          " samples: %r" % [int(l) for l in lengths])
      205 
      206 
  
  ValueError: Found input variables with inconsistent numbers of samples: [356, 209]
  </code></pre>