title: How to calculate Precision, Recall and F-score using python?
body: <p>The labelTrainData.csv is used to train the classifier for predicting sentiments of Testdata.csv. Finally i got BagOfCentroids.csv. </p>
  
  <p><strong>labelTrainData.csv</strong></p>
  
  <pre><code>id   sentiment    Tweet
  1    0            tweet_1
  2    1            tweet_2
  3    0            tweet_3
  </code></pre>
  
  <p><strong>Testdata.csv</strong></p>
  
  <pre><code>id      Tweet
  1       tweet_1
  2       tweet_2
  3       tweet_3
  </code></pre>
  
  <p><strong>BagOfCentroids.csv</strong></p>
  
  <pre><code>id      sentiment
  1       0
  2       1
  3       1
  </code></pre>
  
  <p>To calculate above metrics, I am trying this,</p>
  
  <pre><code>print 'Sentiment precision:'
  
  nltk.metrics.precision(BagOfCentroids['sentiment'], Testdata['sentiment'])
  
  print 'sentiment recall:'
  
  nltk.metrics.recall(BagOfCentroids['sentiment'], Testdata['sentiment'])
  
  print 'sentiment F-measure:'
  
  nltk.metrics.f_measure(BagOfCentroids['sentiment'], Testdata['sentiment'])  
  </code></pre>
  
  <p>Is there any way to calculate Precision, Recall and F-score?</p>