TypeError                                 Traceback (most recent call last)
Cell In[58], line 161
    159 plt.xlabel("FPR")        
    160 plt.ylabel("TPR")
--> 161 plt.annotate(xy= (.4,.2),xytext= (.5,.2),s = 'ROC curve (area = % 0.2f)' % auc_test)

TypeError: annotate() missing 1 required positional argument: 'text'

后面百度查了一下发现,matplotlib3.3及以后,将这个函数中的参数s改为了test。 

解决办法:

将参数改为test=test。

还有一种办法将这个matplotlib包降到3.3之前的版本。不过第一种解决办法比较简单,在这里建议使用第一种方法。