Showing
2 changed files
with
10 additions
and
3 deletions
... | @@ -195,9 +195,10 @@ if __name__ == "__main__": | ... | @@ -195,9 +195,10 @@ if __name__ == "__main__": |
195 | history = model.fit(train_features, train_labels, | 195 | history = model.fit(train_features, train_labels, |
196 | epochs=50, verbose=0, validation_split=0.25) | 196 | epochs=50, verbose=0, validation_split=0.25) |
197 | 197 | ||
198 | - # Print model metrics | 198 | + # Print training metrics |
199 | - print("Model metics:") | 199 | + print("Training metrics:") |
200 | - print("\n\t%s:" % (model.metrics_names[1])) | 200 | + model.evaluate(train_features, train_labels) |
201 | + print("\n%s:" % (model.metrics_names[1])) | ||
201 | 202 | ||
202 | # Plot training-validation loss | 203 | # Plot training-validation loss |
203 | plt.figure() | 204 | plt.figure() |
... | @@ -223,6 +224,12 @@ if __name__ == "__main__": | ... | @@ -223,6 +224,12 @@ if __name__ == "__main__": |
223 | 224 | ||
224 | # Predict with rest data set | 225 | # Predict with rest data set |
225 | predicted_labels = model.predict(np.stack(test_features)) | 226 | predicted_labels = model.predict(np.stack(test_features)) |
227 | + | ||
228 | + # Print test metrics | ||
229 | + print("Test metrics:") | ||
230 | + model.evaluate(train_features, train_labels) | ||
231 | + print("\n%s:" % (model.metrics_names[1])) | ||
232 | + | ||
226 | # Print confusion matrix | 233 | # Print confusion matrix |
227 | cm = confusion_matrix(np.argmax(test_labels, axis=1), | 234 | cm = confusion_matrix(np.argmax(test_labels, axis=1), |
228 | np.argmax(predicted_labels, axis=1)) | 235 | np.argmax(predicted_labels, axis=1)) | ... | ... |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment