机器学习-归一化
作者:互联网
def autoNorm(dataSet):#归一化,使用公式为 newValue=(oldValue-min)/(max-min)
minVals = dataSet.min(0)
maxVals = dataSet.max(0)
ranges = maxVals - minVals
normDataSet = zeros(shape(dataSet))
m = dataSet.shape[0]
normDataSet = dataSet - tile(minVals, (m,1))
normDataSet = normDataSet/tile(ranges, (m,1)) #element wise divide
return normDataSet, ranges, minVals
标签:ranges,机器,min,normDataSet,归一化,dataSet,学习,minVals 来源: https://www.cnblogs.com/jiading/p/11621875.html