diff --git a/ecg/eval-keras.py b/ecg/eval-keras.py index ddb32876..6b9ef136 100644 --- a/ecg/eval-keras.py +++ b/ecg/eval-keras.py @@ -25,14 +25,15 @@ predictions = np.load(open(args.prediction_path, 'rb')) y_val_flat = np.argmax(y_val, axis=-1).flatten().tolist() - y_val_flat.extend(range(len(dl.classes))) predictions_flat = np.argmax(predictions, axis=-1).flatten().tolist() - predictions_flat.extend(range(len(dl.classes))) print(classification_report( y_val_flat, predictions_flat, target_names=dl.classes)) + y_val_flat.extend(range(len(dl.classes))) + predictions_flat.extend(range(len(dl.classes))) + cnf_matrix = confusion_matrix(y_val_flat, predictions_flat).tolist() for i, row in enumerate(cnf_matrix): row.insert(0, dl.classes[i])