Commit 6311ffc7 authored by Petra's avatar Petra

aesthetic modification to 8_neural_nets-perceptron.py

parent 245b8b9e
......@@ -26,14 +26,6 @@ X = df[feature_cols].values
y = df[target_var].values
print("Features: ", feature_cols, "\nTarget:", target_var)
# one hot encode outputs
#y_train = np_utils.to_categorical(y_train)
#y_validation = np_utils.to_categorical(y_validation)
#y_test = np_utils.to_categorical(y_test)
#num_classes = y_test.shape[1]
print(""" --- Train-test split ---""")
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.1, random_state=42)
print("train set X shape: ", X_train.shape, "train set y shape: ", y_train.shape)
......@@ -41,13 +33,12 @@ print("test set X shape: ", X_test.shape, "test set y shape: ", y_test.shape)
# -------------------------------------------------------------------------------
print (""" --- Introducing a validation set --- """)
# train-validation split
print(""" --- Train-validation split ---""")
X_train, X_validation, y_train, y_validation = train_test_split(X_train, y_train, test_size=0.1, random_state=42)
print("train set X shape: ", X_train.shape, "train set y shape: ", y_train.shape)
print("validation set X shape: ", X_validation.shape, "validation set y shape: ", y_validation.shape)
print("test set X shape: ", X_test.shape, "test set y shape: ", y_test.shape)
# -------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
print("""-----------------------------------------------------""")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment