I am using sklearn StandardScaler to transform/normalize data, as the following:
scaler = StandardScaler()
data = scaler.fit_transform(data)
I am expecting a mean of 0
and a standard deviation of 1
. However, the values I get are bit different.
rnd = randrange(0, data.shape[1])
print(data[:,rnd].std())
print(data[:,rnd].mean())
1.0282903146389404
-0.06686584736835668
It seems very close numbers to 0 and 1 should be acceptable; however, not sure what is the acceptable offset. For instance, +/- 1e-2
, as I'm getting, is close enough? or I should be concerned?