简体   繁体   English

难以理解具有多个特征的线性回归

[英]Difficulty in understanding linear regression with multiple features

Let's say price of houses(target variable) can be easily plotted against area of houses(predictor variables) and we can see the data plotted and draw a best fit line through the data. 假设可以轻松针对房屋面积(预测变量)绘制房屋价格(目标变量),并且可以看到绘制的数据并通过数据绘制一条最佳拟合线。

However, consider if we have predictor variables as ( size, no.of bedrooms,locality,no.of floors ) etc. How am I gonna plot all these against the target variable and visualize them on a 2-D figure? 但是,考虑一下我们是否具有预测变量(大小,卧室数,位置,楼层数)等。我该如何针对目标变量绘制所有这些变量并将其可视化为二维图形?

If you truly want a 2D figure, that's certainly not easy. 如果您确实想要2D图形,那肯定不容易。 One possible approach would be to reduce the dimensionality of your data to 2 using something like Principal Component Analysis . 一种可能的方法是使用主成分分析之类的方法将数据的维数减少到2。 Then you can plot it in two dimensions again. 然后,您可以再次将其绘制为二维。 Reducing to 3 dimensions instead of 2 might also still work, humans can understand 3D plots drawn on a 2D screen fairly well. 缩小到3个尺寸而不是2个尺寸可能仍然可行,人类可以很好地理解在2D屏幕上绘制的3D图。

You don't normally need to do linear regression by hand though, so you don't need a 2D drawing of your data either. 但是,您通常通常不需要手动进行线性回归,因此也不需要数据的2D绘图。 You can just let your computer compute the linear regression, and that works perfectly fine with way more than 2 or 3 dimensions. 您可以让您的计算机计算线性回归,并且在超过2或3维的情况下可以很好地工作。

The computation shouldn't be an issue (the math works regardless of dimensionality), but the plotting definitely gets tricky. 计算不应该是一个问题(无论维数如何,数学都可以起作用),但是绘制肯定会很棘手。 PCA can be hard to interpret and forcing orthogonality might not be appropriate here. PCA可能难以解释,而在此处强制正交可能不合适。 I'd check out some of the advice provided here: https://stats.stackexchange.com/questions/73320/how-to-visualize-a-fitted-multiple-regression-model 我会查看此处提供的一些建议: https : //stats.stackexchange.com/questions/73320/how-to-visualize-a-fitted-multiple-regression-model

Fundamentally, it depends on what you are trying to communicate. 从根本上讲,这取决于您要交流的内容。 Goodness of fit? 适合度? Maybe throw together multiple plots of residuals. 也许将多个残差图放在一起。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM