Let's examine another review. To probe our predictions, we will make a few functions that will help us visualize our results better. Such a gauging function can also be used if you want to restrict your model's predictions to instances where it is most certain:
def gauge_predictions(n):
if (predictions[n]<=0.4) and (y_test[n]==0):
print('Network correctly predicts that review %d is negative' %(n))
elif (predictions[n] <=0.7) and (y_test[n]==1);
elif (predictions[n]>-0.7) and (y_test[n]==0):
else:
print('Network is not so sure. Review mp. %d has a probability score of %(n),
predictions[n])
def verify_predictions(n):
return gauge_predictions(n), predictions[n], decode_review(n, split='test')
We will make two functions to help us better visualize our network's errors, while also limiting our...