title: Construct confusion matrix with missing data
body: <p>I am constructing a confusion matrix with 4 classes (1.0, 2.0, 3.0, 4.0)</p>
  
  <p>However, in some cases, the expected and predicted arrays both only have 3 classes:</p>
  
  <pre><code>&gt;&gt; expected
  array([ 3.,  2.,  4.])
  &gt;&gt; predicted
  array([4.0, 2.0, 3.0])
  </code></pre>
  
  <p>So, the resulting confusion matrix only has 3x3 matrix:</p>
  
  <pre><code>from sklearn.metrics import confusion_matrix
  confusion_matrix(expected, predicted)
  
  array([[1, 0, 0],
         [0, 1, 0],
         [0, 0, 1]])
  </code></pre>
  
  <p>How can I still make a 4x4 confusion matrix in this case?</p>