机器学习-归一化

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
上一篇:单线激光雷达(Lidar)学习四:使用雷达进行目标跟随(二)


下一篇:LeetCode 352. Data Stream as Disjoint Intervals