def plot_confusion_matrix(model, X_test, y_test, fold):
    y_pred = model.predict(X_test)
    y_pred = y_pred.argmax(axis=(- 1))
    y_test = y_test.argmax(axis=(- 1))
    cm = confusion_matrix(y_test, y_pred)
    ax = plt.subplot()
    sns.heatmap(cm, annot=True, fmt='g', ax=ax)
    ax.set_xlabel('Predicted labels')
    ax.set_ylabel('True labels')
    ax.set_title(f'Confusion Matrix – {config.EPOCHS}|{fold}')
    ax.xaxis.set_ticklabels(['Negative', 'Positive'])
    ax.yaxis.set_ticklabels(['Negative', 'Positive'])
    plt.savefig(f'../plots/covid_confusion_{config.EPOCHS}epochs_{fold}v{config.K_FOLD_SPLITS}fold.png')
    clear_plot()
def plot_confusion_matrix(model, X_test, y_test, fold):
    y_pred = model.predict(X_test)
    y_pred = y_pred.argmax(axis=(- 1))
    y_test = y_test.argmax(axis=(- 1))
    cm = confusion_matrix(y_test, y_pred)
    ax = plt.subplot()
    sns.heatmap(cm, annot=True, fmt='g', ax=ax)
    ax.set_xlabel('Predicted labels')
    ax.set_ylabel('True labels')
    ax.set_title(f'Confusion Matrix – {config.EPOCHS}|{fold}')
    ax.xaxis.set_ticklabels(['Negative', 'Positive'])
    ax.yaxis.set_ticklabels(['Negative', 'Positive'])
    plt.savefig(f'../plots/covid_confusion_{config.EPOCHS}epochs_{fold}v{config.K_FOLD_SPLITS}fold.png')
    clear_plot()