回归问题:如何解决高十进制输入功能的问题 [英] Regression Problem: How to solve the problem of highly decimal input features

查看:22
本文介绍了回归问题:如何解决高十进制输入功能的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我具有以下输入数据结构:

I have the following input data structure:

   X1     |    X2     |    X3     | ... | Output (Label)
118.12341 | 118.12300 | 118.12001 | ... | [a value between 0 & 1] e.g. 0.423645

我在哪里使用 tensorflow 来解决这里的回归问题,即预测 Output 变量的未来值.为此,我建立了一个前馈神经网络,该网络具有三个具有 relu 激活功能的隐藏层,以及一个最终输出层,具有一个线性激活节点.该网络使用 adam 优化器进行反向传播训练.

Where I'm using tensorflow in order to solve the regression problem here of predicting the future value of the Output variable. For that i built a feed forward neural network with three hidden layers having relu activation functions and a final output layer with one node of linear activation. This network is trained with back-propagation using adam optimizer.

我的问题是,在将网络训练了数千个纪元之后,我意识到输入要素和输出中的这个高十进制值导致预测仅接近第二个小数位,例如:

My problem is that after training the network for some thousands of epochs, I realized that this highly decimal values in both input features and the output, resulted in predictions near to the second decimal place only, for example:

Real value = 0.456751 | Predicted value = 0.452364

但是这是不可接受的,我需要至少精确到小数点后四位才能接受该值.

However this is not accepted, where i need a precision to the forth decimal place (at least) to accept the value.

问:是否有可信赖的技术来正确解决此问题以获得更好的结果(也许是一种转换算法)?

Q: Is there any trustworthy technique to solve this problem properly for getting better results (maybe a transformation algorithm)?

谢谢.

推荐答案

假设您使用的是常规的MSE丢失,这可能不适合您在每个实例的错误中容忍度相对较低的目的.详细地说,MSE定义为预测输出与真实输出之间差异的平方的平均值.

Assuming you are using a regular MSE loss, this will probably not suit your purpose of relatively low-tolerance in the error per instance. To elaborate, the MSE is defined as follow the average of the the square of the differences between the predicted and true outputs.

假设您有4个实例,以及两个受过训练的函数,每个实例都会产生以下错误:

Assuming you have 4 instances, and two trained functions that generates the following error per instance:

F1错误率:(4,.0004,.0002,.0002)

F1 error rates : (4,.0004, .0002, .0002)

F2错误率:(.9,.9,.9,.9)

F2 error rates : (.9, .9, .9, .9)

很明显,MSE会采用F2,因为平均MSE为0.81,而F1的平均MSE约为16.

It's obvious that MSE would go for F2, since the average MSE is .81, while the average MSE for F1 is approx 16.

因此,可以得出结论,MSE太小重视价值的微小差异<1,但由于应用了 square 函数,它会夸大权重以实现值> 1的更大差异.

So to conclude, MSE gives too little weight to small differences in value < 1, while it exaggerates the weight for bigger differences in value > 1 because of the square function applied.

您可以尝试MAE,MAE表示MEAN ABSOLUTE ERROR,它唯一的区别是它不会对单个错误执行平方函数,而是计算绝对值.还有许多其他回归损失可以大大减轻较小误差的影响,例如具有较小增量(<0)的 HUBER 损失,您可以阅读有关这些损失的更多信息

You could try MAE, which stands for MEAN ABSOLUTE ERROR, it's only difference is that it doesn't perform a square function on the individual errors, rather it calculates the absolute. There are many other regression losses that could give significant weight to smaller errors like the HUBER loss with a small delta (< 0), you can read more about those losses here.

另一种可能的解决方案是将其转化为分类问题,例如,如果预测与至小数点后第四位的输出完全相同,则预测为真,否则为假.

Another possible solution would be to transform this into a classification problem, where the prediction is true if it's exactly identical to the outputs to the 4th decimal point for example and else it's false.

这篇关于回归问题:如何解决高十进制输入功能的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆