ValueError: continuous format is not supported

在训练xgboost的时候,出现了这个错误:


  File "E:\ana\lib\site-packages\sklearn\metrics\base.py", line 73, in _average_binary_score
    raise ValueError("{0} format is not supported".format(y_type))

ValueError: continuous format is not supported

这个问题是自己手贱造成的,因为自己明明在做回归,结果是用的做分类的计分方式做的:

from sklearn.metrics import roc_auc_score
 score = roc_auc_score(y_valid.values, check)

当然改回来就没事了

from sklearn.metrics import explained_variance_score
 score = explained_variance_score(y_valid.values, check)

 

你可能感兴趣的:(Python)