aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtrain.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/train.py b/train.py
index b76f5e2..134b70a 100755
--- a/train.py
+++ b/train.py
@@ -42,7 +42,7 @@ M = args.eigen
raw_faces = genfromtxt(args.data, delimiter=',')
targets = np.repeat(np.arange(10),52)
-faces_train, faces_test, target_train, target_test = train_test_split(raw_faces, targets, test_size=0.5, random_state=0)
+faces_train, faces_test, target_train, target_test = train_test_split(raw_faces, targets, test_size=0.2, random_state=0)
# This remove the mean and scales to unit variance
@@ -65,7 +65,7 @@ else:
# Plot the variances (eigenvalues) from the pca object
if args.graph:
- plt.bar(np.arange(M), explained_variances)
+ plt.bar(np.arange(explained_variances.size), explained_variances)
plt.ylabel('Varaiance ratio');plt.xlabel('Face Number')
plt.show()