Can I get some examples where Linear Regression might give inaccurate prediction? Preferably with Python code example. I have obtained one example in Anscombe's Quartet. Any others?
1 Answers
I am going to assume you are talking about using a linear regression model in Machine Learning (as in creating a linear equation to predict the outputs associated with some future unknown inputs). Instead of "accuracy," we instead often think about minimizing risk (thus maximizing accuracy).
So your question is essentially asking when would a linear regression model give us high risk (more specifically high risk on unforeseen data, often estimated using Structural risk). The answer to that question involves many factors, which are described in detail here and here.
One factor which could be considered the most important, and that I think is what you are really asking, is whether the output value for a given input value can be found through a linear combination of the input variables – either in the original state of the input variables or after transformation of the input variables, although of course depending on the transformation done one must be careful not to overfit.
- 56
-
As a general proposition, whether the input variables enjoy any linear relationship among each other is completely irrelevant in linear regression. I believe what you meant to say is that the response variable must be reasonably well described by a linear combination of the explanatory (input) variables. – whuber Dec 21 '21 at 23:49
Rcode). – whuber Dec 14 '21 at 20:51