Created
January 23, 2019 06:41
-
-
Save gkhayes/0505fe31612acc6bc29bb60c6215f374 to your computer and use it in GitHub Desktop.
Make predictions from neural network fitted to Iris dataset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.metrics import accuracy_score | |
# Predict labels for train set and assess accuracy | |
y_train_pred = nn_model1.predict(X_train_scaled) | |
y_train_accuracy = accuracy_score(y_train_hot, y_train_pred) | |
print('Training accuracy: ', y_train_accuracy) | |
# Predict labels for test set and assess accuracy | |
y_test_pred = nn_model1.predict(X_test_scaled) | |
y_test_accuracy = accuracy_score(y_test_hot, y_test_pred) | |
print('Test accuracy: ', y_test_accuracy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment