假设我使用以下内容将我的数据集规范化为[1,-1]:
Public Function NormalizeData(values As Double()) As Double()
Dim min = values.Min
Dim max = values.Max
Return values.Select(Function(val) 2 * (val - min) / (max - min) - 1).ToArray
End Function
我如何根据该数据集对值进行反规范化:
Public Function DeNormalizeData(baseData As Double(), value As Double) As Double
Dim min = baseData.Min
Dim max = baseData.Max
Return '??
End Function
答案 0 :(得分:2)
找到函数的反函数:dn =非规范化,n =规范化
n= 2*((dn-min)/(max-min)) - 1
向双方添加1
n+1=2*((dn-min)/(max-min))
除以2
(n+1)/2=(dn-min)/(max-min)
乘以(max-min)
((max-min)*(n+1))/2 = dn - min
将min添加到两个
dn =(((max-min)*(n+1))/2)+min
您现在可以使用去标准化功能,因为您可以看到需要保存最大值和最小值。
public function DeNormalize(n as double, min as double, max as double) as double
return (((max-min)*(n+1))/2)+min
end function