Wednesday, 30 September 2020

Change legend items in plot-metrics chart of roc curve

I'm using plot-metrics library for creating ROC chart.

I'm trying to create the chart for three different models I have created in order to compare between them and show which model is the best one. The problem is that I cannot edit the legend and I get the random guess appear 3 times + cannot edit the item names in the legend (e.g model 1, model 2 and model 3).

this is how I generated this chart:

from plot_metric.functions import BinaryClassification
# Visualisation with plot_metric
bcl = BinaryClassification(y_test, predictions1, labels=["TREAT1", "TREAT2"])
bcrf = BinaryClassification(y_test, predictions2, labels=["TREAT1", "TREAT2"])
bcxgb = BinaryClassification(y_test, predictions3, labels=["TREAT1", "TREAT2"])

# Figures
plt.figure(figsize=(5,5))
bcl.plot_roc_curve(plot_threshold=False,c_roc_curve='b', title='Receiver Operating Characteristic')
bcrf.plot_roc_curve(plot_threshold=False,c_roc_curve='green')
bcxgb.plot_roc_curve(plot_threshold=False,c_roc_curve='purple')

plt.show()

enter image description here

I thought there is parameter for this (True ot false for the random guess) but there is only for the threshold and other parameters and also couldn't find any parameter for the legend:
https://plot-metric.readthedocs.io/en/latest/

My end goal: to change the legend items names and not to have the Random guess 3 times.



from Change legend items in plot-metrics chart of roc curve

No comments:

Post a Comment