title: Should I normalize training and test test separately after shuffling and splitting?
body: <p>I want to normalize my data in the range [0,1]. Should I normalize data after shuffling and splitting?Should I repeat the same procedure for test test? I came across a python code which was using such type of normalization. Is this the correct way to normalize data with target range [0,1]  </p>
  
  <pre><code>`X_train = np.array([[ 1., -1.,  2.], [ 2.,  0.,  0.],[ 0.,  1., -1.]])
  a= X_train
  for i in range(3):
      old_range = np.amax(a[:,i]) - np.amin(a[:,i])
      new_range = 1 - 0
      f = ((a[:,i] - np.amin(a[:,i])) / old_range)*new_range + 0
      lis.append(f)
  b = np.transpose(np.array(lis))
  print(b)`
  </code></pre>
  
  <p>Here is my result after normalization.</p>
  
  <pre><code>`[[0.5, 0., 1.]
  [1., 0.5, 0.33333333]
  [0., 1., 0.]]`
  </code></pre>