Why does my linear regression fit line look wrong?

三世轮回 提交于 2019-12-05 03:55:21

A linear regression is a method to fit a linear function to a set of points (observations) minimizing the least-squares error.

Now imagine your heatmap indicating a shape where you would assume a vertical line fitting best. Just turn your heatmap 10 degrees counter clock-wise and you have it.

Now how would a linear function supposed to be defined which is vertical? Exactly, it is not possible.

The result of this little thought experiment is that you confuse the purpose of linear regression and what you most likely want is - as indicated already by Gavin Simpson - the 1st principal component vector.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!