From d908c12d5c5ed43b211d1a6893e56db56df7ed7b Mon Sep 17 00:00:00 2001
From: lucas_miranda <lucasmiranda42@gmail.com>
Date: Sat, 4 Jul 2020 14:40:49 +0200
Subject: [PATCH] Implemented shuffle parameter in preprocessing; shuffled
 validation data in model_training.py

---
 source/preprocess.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/source/preprocess.py b/source/preprocess.py
index 9ca0b716..ae3c3921 100644
--- a/source/preprocess.py
+++ b/source/preprocess.py
@@ -534,13 +534,19 @@ class table_dict(dict):
                 X_test = X_test * g.reshape(1, window_size, 1)
 
             if shuffle:
-                X_train = np.random.choice(X_train, X_train.shape[0], replace=False)
-                X_test = np.random.choice(X_test, X_test.shape[0], replace=False)
+                X_train = X_train[
+                    np.random.choice(X_train.shape[0], X_train.shape[0], replace=False)
+                ]
+                X_test = X_test[
+                    np.random.choice(X_test.shape[0], X_test.shape[0], replace=False)
+                ]
 
             return X_train, X_test
 
         if shuffle:
-            X_train = np.random.choice(X_train, X_train.shape[0], replace=False)
+            X_train = X_train[
+                np.random.choice(X_train.shape[0], X_train.shape[0], replace=False)
+            ]
 
         return X_train
 
-- 
GitLab