问题描述
raise ValueError("{0} format is not supported".format(y_type))
ValueError: continuous format is not supported
通过scikit-learn
的包进行计算AUC-ROC
,其中y_true_px_list
和y_pred_px_list
是一个一维的列表
报错
原因分析
输入的类型问题,就是一维列表y_true_px_list
和y_pred_px_list
中的元素的类型问题
问题解决
这里需要把真实标签对应的列表中的元素弄成int64
,预测的标签都行,这样就可以了
outputs = outputs.flatten()
targets = targets.flatten().astype("int64")
y_pred_px_list.extend(outputs)
y_true_px_list.extend(targets)
就是添加元素到列表之前转成float64
即可