title: StandardScaler in Spark not working as expected
body: <p>Any idea why spark would be doing this for <code>StandardScaler</code>? As per the definition of <code>StandardScaler</code>: </p>
  
  <blockquote>
    <p>The StandardScaler standardizes a set of features to have zero mean
    and a standard deviation of 1. The flag withStd will scale the data to
    unit standard deviation while the flag withMean (false by default)
    will center the data prior to scaling it.</p>
  </blockquote>
  
  <pre class="lang-python prettyprint-override"><code>&gt;&gt;&gt; tmpdf.show(4)
  +----+----+----+------------+
  |int1|int2|int3|temp_feature|
  +----+----+----+------------+
  |   1|   2|   3|       [2.0]|
  |   7|   8|   9|       [8.0]|
  |   4|   5|   6|       [5.0]|
  +----+----+----+------------+
  
  &gt;&gt;&gt; sScaler = StandardScaler(withMean=True, withStd=True).setInputCol("temp_feature")
  &gt;&gt;&gt; sScaler.fit(tmpdf).transform(tmpdf).show()
  +----+----+----+------------+-------------------------------------------+
  |int1|int2|int3|temp_feature|StandardScaler_4fe08ca180ab163e4120__output|
  +----+----+----+------------+-------------------------------------------+
  |   1|   2|   3|       [2.0]|                                     [-1.0]|
  |   7|   8|   9|       [8.0]|                                      [1.0]|
  |   4|   5|   6|       [5.0]|                                      [0.0]|
  +----+----+----+------------+-------------------------------------------+
  </code></pre>
  
  <p>In numpy world</p>
  
  <pre class="lang-python prettyprint-override"><code>&gt;&gt;&gt; x
  array([2., 8., 5.])
  &gt;&gt;&gt; (x - x.mean())/x.std()
  array([-1.22474487,  1.22474487,  0.        ])
  </code></pre>
  
  <p>In sklearn world</p>
  
  <pre class="lang-python prettyprint-override"><code>&gt;&gt;&gt; scaler = StandardScaler(with_mean=True, with_std=True)
  &gt;&gt;&gt; data
  [[2.0], [8.0], [5.0]]
  &gt;&gt;&gt; print(scaler.fit(data).transform(data))
  [[-1.22474487]
   [ 1.22474487]
   [ 0.        ]]
  </code></pre>