title: why does scikitlearn says F1 score is ill-defined with FN bigger than 0?
body: <p>I run a python program that calls <code>sklearn.metrics</code>'s methods to calculate precision and F1 score. Here is the output when there is no predicted sample:</p>
  
  <pre><code>/xxx/py2-scikit-learn/0.15.2-comp6/lib/python2.6/site-packages/sklearn/metr\
  ics/metrics.py:1771: UndefinedMetricWarning: Precision is ill-defined and being set to 0.0 due to no predicted samples.
    'precision', 'predicted', average, warn_for)
  
  /xxx/py2-scikit-learn/0.15.2-comp6/lib/python2.6/site-packages/sklearn/metr\
  ics/metrics.py:1771: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 due to no predicted samples.
    'precision', 'predicted', average, warn_for)
  </code></pre>
  
  <p>When there is no predicted sample, it means that TP+FP is 0, so </p>
  
  <ul>
  <li>precision (defined as TP/(TP+FP)) is 0/0, not defined, </li>
  <li>F1 score (defined as 2TP/(2TP+FP+FN)) is 0 if FN is not zero.</li>
  </ul>
  
  <p>In my case, <code>sklearn.metrics</code> also returns the accuracy as 0.8, and recall as 0. So FN is not zero.</p>
  
  <p>But why does scikilearn says F1 is ill-defined?</p>
  
  <p>What is the definition of F1 used by Scikilearn?</p>