I am working on a for loop to assign numbers to the classes and I am successful in that but I find it hard to simultaneously insert different colors based on the number of classes using the same for loop but I am getting the error :'list' object cannot be interpreted as an integer
Below is the code:
n_class = 5
colors = ['r', 'g', 'b', 'y','k', 'y']
# plotting
for i, c in range(n_class, colors):
plt.plot(fpr[i], tpr[i], linestyle='--',color=[c], label= 'Class %d' %i )
plt.title('Multiclass ROC curve')
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive rate')
plt.legend(loc='best')
plt.savefig('Multiclass ROC',dpi=300);
rangecorrectly. Its two-argument form is range(low, high). What you actually want isfor i, c in enumerate(colors):