title: NameError: name 'classifier' is not defined
body: <p>I am new to machine learning. I was trying to predict on a dataset but when I run the program it give me following error:</p>
  
  <pre><code>NameError: name 'classifier' is not defined 
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>import numpy as np
  from keras.preprocessing import image
  test_image = image.load_img('dataset/single_prediction/1.jpg', target_size = (64, 64))
  test_image = image.img_to_array(test_image)
  test_image = np.expand_dims(test_image, axis = 0)
  result = classifier.predict(test_image)
  training_set.class_indices
  if result[0][0] == 1:
    prediction = 'nsfw'
  else:
    prediction = 'sfw'
  </code></pre>