如何使用scikitplot绘制多个分类器的ROC曲线?

时间:2019-11-22 02:27:50

标签: matplotlib plot classification roc

我已经通过使用多个分类器对具有多个类(不是二进制)的数据进行了分类,并且我想通过使用scikitplot绘制它们的ROC曲线来比较这些分类器的性能。

下面的代码分别为每个模型生成ROC曲线,我想将它们放在相同的图形上并使用scikitplot保持。 任何建议将不胜感激!

from sklearn.pipeline import make_pipeline
import matplotlib.pyplot as plt
import scikitplot as skplt
import matplotlib.pyplot as plt
from matplotlib.pyplot import *
fig = plt.figure()
for i in range(0,6):
    num+=1
    predicted_probas = model[i].predict_proba(X_test)
    skplt.metrics.plot_roc(y_test, predicted_probas, plot_micro=False, plot_macro=False, classes_to_plot=1)
    plt.title('ROC Curve of '+model_name[i])
    plt.show()

enter image description here

0 个答案:

没有答案
相关问题