Python
1.python里的向量维度是一维的,且不分行向量与列向量,要想区分行向量与列向量要将向量看成矩阵

2.用创建矩阵的方式创建行向量与列向量


3.将矩阵转换为一维数组ndim由2变为1


4.矩阵的合并



5.缩放
一 MinMaxScaler

注意:MinMaxScaler只能对ndim为2的向量进行操作,ndim为1的可以通过reshape(1,-1)改为2维的向量




OK!!!以上我们明白要想使用Minmaxscale,输入必须是二维的!刚刚我们使用的向量,现在我们试一试矩阵!


对于机器学习而言,按行归一化就是按样本归一化,按列归一化是按特征归一化,其背后的意义完全不同!!(神经网络等输入矩阵,通常一行代表一个样本,喜欢横着放)
网友评论