标准化以标准化多维数组的列。功能Standardize将多维数组数据_矩阵作为其输入参数。它从每一列中提取平均值并除以标准差。它返回标准化矩阵、平均值行和标准偏差行。
def standardise(data_matrix): ### BEGIN SOLUTION row_of_means = np.mean(data_matrix, axis=0) standardised_matrix = data_matrix - row_of_means row_of_stds = np.std(standardised_matrix, axis=0) return (standardised_matrix / row_of_stds), row_of_means, row_of_stds ### END SOLUTION
def de_standardise(standardised_matrix, row_of_means, row_of_stds): ### BEGIN SOLUTION matrix = np.copy(standardised_matrix * row_of_stds) return matrix + row_of_means ### END SOLUTION


![[Python语音识别项目笔记] 2矩阵标准化和去标准化 [Python语音识别项目笔记] 2矩阵标准化和去标准化](http://www.mshxw.com/aiimages/31/738180.png)
