因此,众所周知,在训练集中缩放特征/训练样本是个好主意,这样绝对意义上的值就不会有太大的差别。例如,我们想训练一个神经网络来学习一个简单的二次函数y= x*x。
比如说,训练数据看起来像是输入数据的x= 1,2,3,4,5,6,目标数据的y= 1、4、9、16、25、36。
很明显,可以通过x := x/6和y := y/36来缩放输入和输出数据,因此所有的训练值都在0:1范围内。
我的问题是,如果我想要预测输入7的输出值,该怎么办?如果我将7/6输入到网络中,然后通过执行输出:=输出* 36来重新分配输出,则不会得到正确的结果。如何解决这一问题?
发布于 2018-10-18 22:58:38
根据您的假设,如果您正在缩放这些特性,使它们在0到1之间转换,那么输入7的情况将导致一个重标度的特性,它将大于1 (7/6 > 1)。因此,这告诉我们,你的缩放技术,把输入除以一个特定的数字,并不是一个很好的缩放方法。
对于您的具体问题,缩放并不是必要的,正如这里所解释的。重要的部分是:
If the input variables are combined linearly, as in an MLP, then it is rarely
strictly necessary to standardize the inputs, at least in theory. The reason is
that any rescaling of an input vector can be effectively undone by changing the
corresponding weights and biases, leaving you with the exact same outputs as you had
before. However, there are a variety of practical reasons why standardizing the inputs
can make training faster and reduce the chances of getting stuck in local optima.
Also, weight decay and Bayesian estimation can be done more conveniently with
standardized inputs. 但是,如果您仍然对扩展数据感兴趣,那么可以对下面是进行一次很好的讨论,以了解标准化的缩放/规范化技术。
发布于 2018-11-18 13:54:03
您的示例具有误导性,因为您只有一个输入功能,因此缩放没有任何意义。一个更好的例子应该至少有两个特性。我们可以写
其中x和y有不同数量级的值,比如x是年龄,y是工资,z是你想要预测的特征。此时,通过缩放模型,您的模型将以相同的方式对这两个特性进行加权。
https://datascience.stackexchange.com/questions/39881
复制相似问题