May 2020
Intermediate to advanced
404 pages
10h 52m
English
Before continuing with turning this project into a web application using the Django framework, let's quickly test the accuracy obtained in this training of the model. We will carry out the following to make predictions from the model:
predicted_label_probs = model.eval({input: test_data})
This creates a NumPy array of probabilities for each label in the dataset. This has to be converted into indices and compared to the labels of the test data. We do this as shown:
predictions = np.argmax(predicted_label_probs, axis=1)actual = np.argmax(test_encoded, axis=1)correct = np.sum(predictions == actual)print(correct / len(actual))
We find around 98% accuracy in the prediction. This is a very good value and we will ...
Read now
Unlock full access