1个回答
在默认的情况下 StandardScaler就是减去均值,然后除以标准差
from sklearn.preprocessing import StandardScaler
sc = StandardScaler()
相当于$$\frac{原始数值-均值}{标准差}$$
当然在StandardScaler中也可以设置参数with_mean和with_std
from sklearn.preprocessing import StandardScaler
sc = StandardScaler(with_mean=False)
等价于$$\frac{原始数值}{标准差}$$
类似地
from sklearn.preprocessing import StandardScaler
sc = StandardScaler(with_std=False)
等价于$${原始数值-均值}$$
不错不错
-
姜金杰
2018-02-02 14:12