title: TFlearn Accuracy
body: <p>after building DNN with TFlearn, I want to calculate the accuracy of the net.</p>
  
  <p>here is the code:</p>
  
  <pre><code>def create_model(self):
      x = tf.placeholder(dtype= tf.float32, shape=[None, 6], name='x')
      # Build neural network
      input_layer = tflearn.input_data(shape=[None, 6])
      net = input_layer
      net = tflearn.fully_connected(net, 128, activation='relu')
      net = tflearn.fully_connected(net, 64, activation='relu')
      net = tflearn.fully_connected(net, 16, activation='relu')
      net = tflearn.fully_connected(net, 2, activation='sigmoid')
      net = tflearn.regression(net, optimizer='adam', loss='mean_square', metric='R2')
  
      w = tf.Variable(tf.truncated_normal([2, 2], stddev=0.1))
      b = tf.Variable(tf.constant(1.0, shape=[2]))
      y = tf.nn.softmax(tf.matmul(net, w) + b, name='y')
  
      model = tflearn.DNN(net, tensorboard_verbose=3)
      return model
  </code></pre>
  
  <p>here is the training part: </p>
  
  <pre><code>train_data, train_goal, test_data, test_goal = self.normalize_data()
          model = self.create_model()
  
          # train model with train sets &amp; evaluate on test sets
          model.fit(train_data, train_goal, validation_set=0.2, n_epoch=10, show_metric=True, snapshot_epoch=True)
          result = model.evaluate(test_data, test_goal)
  </code></pre>
  
  <p>How can I calculate the accuracy? 
  also, what should I change to make in categorical? 
  Thanks</p>