From 56997876d5f131713f5f3525d413ee391d85e482 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Mon, 19 Nov 2018 17:48:45 +0000 Subject: Add cm for ensemble --- train.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/train.py b/train.py index dd3633f..3c867a2 100755 --- a/train.py +++ b/train.py @@ -277,6 +277,14 @@ def main(): target_pred_comb = np.zeros(target_pred.shape[1]) target_pred = target_pred.astype(int).T + if (args.conf_mat): + cm = confusion_matrix(np.tile(target_test, args.ensemble), target_pred.flatten('F')) + plt.matshow(cm, cmap='Blues') + plt.colorbar() + plt.ylabel('Actual') + plt.xlabel('Predicted') + plt.show() + for i in range(target_pred.shape[0]): target_pred_comb[i] = np.bincount(target_pred[i]).argmax() target_pred = target_pred_comb -- cgit v1.2.3-54-g00ecf