title: Python one-liner for a confusion/contingency matrix needed
body: <p>I want to write a one-liner to calculate a confusion/contingency matrix M (square matrix with either dimension equal to the number of classes ) that counts the cases presented in two vectors of lenght n: Ytrue and Ypredicted. Obiously the following does not work using python and numpy:<br></p>
  
  <pre><code>error = N.array([error[x,y]+1 for x, y in zip(Ytrue,Ypredicted)]).reshape((n,n))
  </code></pre>
  
  <p>Any hint to create a one-liner matrix confusion calculator?</p>