title: Normalisation of test dataset
body: <p>I have train(x_train) and test(x_test) datasets, but I'm not sure how to normalise it.</p>
  
  <p>The first option is to use mean and deviation of train dataset:</p>
  
  <pre><code>(x_train-np.mean(x_train))/np.std(x_train)
  (x_test-np.mean(x_train))/np.std(x_train)
  </code></pre>
  
  <p>The second option is to combine x_train and x_test to get overall mean and deviation:</p>
  
  <pre><code>x=np.vstack((x_train,x_test))
  (x_train-np.mean(x))/np.std(x)
  (x_test-np.mean(x))/np.std(x)
  </code></pre>
  
  <p>Can you please explain me how to choose between these two methods, is any of them is not correct?</p>