Python-sklearn学习中碰到的问题

1.运用sklearn包中的metrics.auc()计算模型AUC值时出现以下错误

    

    auc = metrics.auc(fpr, tpr)
  File "/usr/local/lib/python2.7/site-packages/sklearn/metrics/metrics.py", line 172, in auc
    x, y = check_arrays(x, y)
  File "/usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py", line 233, in check_arrays
    _assert_all_finite(array)
  File "/usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py", line 27, in _assert_all_finite
    raise ValueError("Array contains NaN or infinity.")
ValueError: Array contains NaN or infinity.

这个错误的信息量不是太高,发生的原因是测试样本中的标签全都是Negtive。

你可能感兴趣的:(python)