Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Distinction between linear and non linear regression?

In Machine Learning, we say that:

  • w1x1 + w2x2 +...+ wnxn is a linear regression model where w1,w2....wn are the weights and x1,x2...x2 are the features whereas:
  • w1x12 + w2x22 +...+ wnxn2 is a non linear (polynomial) regression model

However, in some lectures I have seen people say a model is linear based on the weights, i.e. the coefficients of weights are linear and the degree of the features doesn't matter, whether they are linear(x1) or polynomial(x12). Is that true? How does one differentiate a linear and non linear model? Is it based on weights or feature values?

like image 940
Ram Avatar asked May 04 '16 05:05

Ram


2 Answers

Both flavors exist.

If you are in the Statistics community it is usually former (nonlinearity in features, x^2 or e^x, etc). See this for example.

In the machine learning community the focus is more on the weights; the feature functions can be anything (see for example the kernel trick in SVMs).

The reason for this is that different communities have different approaches for solving these similar problems. The stat community has more of a direct and analytical approach; while the goal of machine learning is slightly different (modeling intricate complex patterns in an unknown concept space).

like image 196
Daniel Avatar answered Sep 18 '22 15:09

Daniel


How does one differentiate a linear and non linear model? Is it based on weights or feature values?

I've only heard / read about it in "a model is linear / nonlinear with respect to the features". This is usually the interesting thing. I don't see how having a term wi2 in your model will help you as it is essentially a constant. Only the features change during testing time.

So a linear model is something that can be expressed as

enter image description here

where the wi define your model and the xi are your input. Different wi result in a different model (but they are all linear with respect to the features). If your model does not fit to that scheme, then your model is not linear with respect to the features.

Now, you can add new features which are essentially only (handcrafted) non-linear transformations of the input. For example, you could make a model

enter image description here

You could argue that this is a non-linear model with respect to the input. However, you can also argue that it is essentially the model

enter image description here

I think the important part here is that it was hand-crafted. You changed the feature space, not the abilities of the model. So it is still a linear model, but in another feature-space. When you go this way, you can make any model to be non-linear.

After all: Does it really matter? It sounds a bit like you're preparing for an exam. If this is the case, I suggest to just ask your lecturer and stick with what he defines as linear / non-linear.

like image 34
Martin Thoma Avatar answered Sep 18 '22 15:09

Martin Thoma