aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2018-11-01 17:12:43 +0000
committerVasil Zlatanov <v@skozl.com>2018-11-01 17:12:43 +0000
commit694567e9584b44ed7b974c87bea71d521db7b57b (patch)
treeeba5855b8eaff1494be8db3c20d6955197c31cdc
parent123b4ad8695a3eb952866bd3aaec91ef71bf5c41 (diff)
downloadvz215_np1915-694567e9584b44ed7b974c87bea71d521db7b57b.tar.gz
vz215_np1915-694567e9584b44ed7b974c87bea71d521db7b57b.tar.bz2
vz215_np1915-694567e9584b44ed7b974c87bea71d521db7b57b.zip
Remove redundant import and whitespace
-rwxr-xr-xtrain.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/train.py b/train.py
index 7d82d73..f09f025 100755
--- a/train.py
+++ b/train.py
@@ -15,7 +15,6 @@ from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
-from sklearn.utils import check_array
import argparse
import numpy as np
@@ -30,8 +29,8 @@ def normalise_faces(average_face, faces):
# Split data into training and testing sets
def test_split(n_faces, raw_faces, split, seed):
random.seed(seed)
- n_cases = 10
- n_pixels = 2576
+ n_cases = 10
+ n_pixels = 2576
raw_faces_split = np.split(raw_faces,n_cases)
n_training_faces = int(round(n_cases*(1 - split)))
@@ -75,7 +74,7 @@ M = args.eigen
raw_faces = genfromtxt(args.data, delimiter=',')
targets = np.repeat(np.arange(52),10)
-n_faces = 52
+n_faces = 52
faces_train, faces_test, target_train, target_test = test_split(n_faces, raw_faces, args.split, args.seed)