What is the definition of precision for no positive classifications?
I just found that sklearn.metrics.precision_score handles it like this:

&gt;&gt;&gt; sklearn.metrics.precision_score(y_true, y_pred)
/home/moose/.local/lib/python2.7/site-packages/sklearn/metrics/classification.py:1074:
  UndefinedMetricWarning: Precision is ill-defined and being
    set to 0.0 due to no predicted samples.
    'precision', 'predicted', average, warn_for)
0.0


So they give a warning and set it to 0.