title: How to interpret scikit's learn confusion matrix and classification report?
body: <p>I have a sentiment analysis task, for this Im using this <a href="http://pastebin.com/ikbKQcsc" rel="noreferrer">corpus</a> the opinions have 5 classes (<code>very neg</code>, <code>neg</code>, <code>neu</code>, <code>pos</code>, <code>very pos</code>), from 1 to 5. So I do the classification as follows:</p>
  
  <pre><code>from sklearn.feature_extraction.text import TfidfVectorizer
  import numpy as np
  tfidf_vect= TfidfVectorizer(use_idf=True, smooth_idf=True,
                              sublinear_tf=False, ngram_range=(2,2))
  from sklearn.cross_validation import train_test_split, cross_val_score
  
  import pandas as pd
  
  df = pd.read_csv('/corpus.csv',
                       header=0, sep=',', names=['id', 'content', 'label'])
  
  X = tfidf_vect.fit_transform(df['content'].values)
  y = df['label'].values
  
  
  from sklearn import cross_validation
  X_train, X_test, y_train, y_test = cross_validation.train_test_split(X,
                                                      y, test_size=0.33)
  
  
  from sklearn.svm import SVC
  svm_1 = SVC(kernel='linear')
  svm_1.fit(X, y)
  svm_1_prediction = svm_1.predict(X_test)
  </code></pre>
  
  <p>Then with the metrics I obtained the following confusion matrix and classification report, as follows:</p>
  
  <pre><code>print '\nClasification report:\n', classification_report(y_test, svm_1_prediction)
  print '\nConfussion matrix:\n',confusion_matrix(y_test, svm_1_prediction)
  </code></pre>
  
  <p>Then, this is the result:</p>
  
  <pre><code>Clasification report:
               precision    recall  f1-score   support
  
            1       1.00      0.76      0.86        71
            2       1.00      0.84      0.91        43
            3       1.00      0.74      0.85        89
            4       0.98      0.95      0.96       288
            5       0.87      1.00      0.93       367
  
  avg / total       0.94      0.93      0.93       858
  
  
  Confussion matrix:
  [[ 54   0   0   0  17]
   [  0  36   0   1   6]
   [  0   0  66   5  18]
   [  0   0   0 273  15]
   [  0   0   0   0 367]]
  </code></pre>
  
  <p>How can I interpret the above confusion matrix and classification report. I tried reading the <a href="http://scikit-learn.org/stable/auto_examples/model_selection/plot_confusion_matrix.html" rel="noreferrer">documentation</a> and this <a href="https://stats.stackexchange.com/questions/95209/how-can-i-interpret-sklearn-confusion-matrix">question</a>. But still can interpretate what happened here particularly with this data?. Wny this matrix is somehow "diagonal"?. By the other hand what means the recall, precision, f1score and support for this data?. What can I say about this data?. Thanks in advance guys</p>