我正在使用基本蚂蚁矿工(蚁群优化算法)。我想找到 F 分数和 ROC 和 Auc 分数。在蚂蚁矿工代码中,我找到了假阳性率和真阳性率的值并应用了函数但没有得到结果。这是代码。
[fpr = false_pos / (false_pos + true_neg)
tpr = true_pos / (true_pos + false_neg)
def plot_roc_curve(fpr,tpr):
plt.plot(fpr,tpr, color='red', label='ROC')
plt.plot(\[0, 1\], \[0, 1\], color='darkblue', linestyle='--')
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.title('Receiver Operating Characteristic (ROC) Curve')
plt.legend()
plt.show()
plot_roc_curve(fpr,tpr)][1]