I evaluate the performance of a random forest using 5 cross-validations on a multiclass classification. The curve that I get is like the picture enter image description here the code i use is as follows
cv=StratifiedKFold(n_splits=5)
classifier = RandomForestClassifier(n_estimators=50,random_state=0)
y_tests = []
y_probabilities = []
for train_index, test_index in cv.split(X, y):
X_train, X_test = X.iloc[train_index,:], X.iloc[test_index,:]
y_train, y_test = y.iloc[train_index], y.iloc[test_index]
probas_ = classifier.fit(X_train, y_train.values.ravel()).predict_proba(X_test)
y_probabilities.append(probas_);
y_tests.append(y_test)
i = 5
for i in range(5):
skplt.metrics.plot_roc(y_tests[i], y_probabilities[i], plot_micro=False, plot_macro=False,title = 'Fold {} ROC Curve sebelum balancing'.format(i+1))
How to be able to display a curve that contains the average of folds for each cross-validation class