title: Understanding UndefinedMetricWarning in classification report with scikit-learn?
body: <p>I have a text classification task with 5 categories the problem is that I am getting bad precision and this warning, probably as a result from unbalaced data(Im not sure):</p>
  
  <pre><code>/usr/local/lib/python2.7/site-packages/sklearn/metrics/metrics.py:1771: UndefinedMetricWarning: Precision is ill-defined and being set to 0.0 in labels with no predicted samples.
  </code></pre>
  
  <p>I guess this warning was produced since the data is clustered in the 5 label. <strong>How can I fix this warning and how can I increase the results of the classification report?</strong>. I also tried a Grid search with the following hyper-parameters:</p>
  
  <pre><code>Best parameters set:
      clf__C: 0.1
      vect__max_df: 0.25
      vect__ngram_range: (1, 1)
      vect__use_idf: True
  
  Accuracy:
  0.456923076923
  </code></pre>
  
  <p>But still getting bad results, could anybody help me to increse this results with SVC or another model?. </p>