scaler = preprocessing.StandardScaler().fit(X_train) X_scaled = scaler.transform(X_train) plt.subplot(3, 1, 2) plt.title("z-Score Normalization by sklearn") sns.distplot(X_scaled, color='r') # 3,利用 numpy 函数实现 z-Score Normalization,并绘制直方图 def z_Score_Normalization(data): ...
X_scaled = scaler.transform(X)# Verify minimum value of all features X_scaled.min(axis=0) # array([0., 0., 0., 0.])# Verify maximum value of all features X_scaled.max(axis=0) # array([1., 1., 1., 1.])# Manually normalise without using scikit-learn ...