Live data from Hacker News

Linear Regression

simonwardjones.co.uk

41–50 of 71 posts

Re: Linear Regression

#41
post #36

Earlier quoted context omitted.

Depends on the tradition you are coming from. In machine learning it really is just that. A synonym for continuous-valued function approximation based on training data. You may say it's only regression if it fits your favorite framework, like giving confidence values or goodness of fit etc, but that's not true in general. There so many variants, like Bayesian probabilistic regression, nonparametrics, neural nets, ran…

It’s a nonstandard definition at best. While regression is a name given to some algorithms (linear and logistic for example), this is an artifact of the statistical foundations of ML. Its standard use in ML is to describe the problem, not the solution: regression is predicting a continuous value and classification is predicting discrete categories. Either use is ok, but e.g. a tree model predicting if an animal is a…

I'd say arguing about this is a huge distraction. Some would say classification is a special case of regression: the predicted continuous values are interpreted as class probabilities.

You're right that regression is a type of task, not a type of solution. The conceptual difference is important to understand if someone does not yet know it. But it's not an all or nothing set-in-stone thing. It implies there is a waterfall design to these ideas, as if some oracle posed these tasks to us and then we started finding solutions to each of them separately. But actually in many cases one and the same algorithm with small tweaks can tackle multiple tasks. Sometimes we have the hammer (algorithm) first and then the nails (task).

How you build your taxonomy and how you categorize one approach or another is not the same as learning and understanding. I always had an issue with this at university, where some lecturers would confuse learning lists like "what are the 3 areas of field X" or what are "the 4 principles of approach Y" etc.

The world is not structured according to subjects, fields, subfields etc. It's not a single hierarchy, but a big mess of similarities, like a graph or a multidimensional space. The map is not the territory and so on.

Terminology is necessary of course for communication and structuring books etc, but I like to see it merely as a utilitarian thing. The categories provide a scaffolding so that learning can happen. Studying the vocabulary and various outlines and nested hierarchies is a useful part of the journey but should not be confused with actually learning the thing itself. You could in principle learn all about regression without ever learning the word "regression".

The name actually originates from statistics, named after the "regression towards the mean" phenomenon, where they observed how the adult height of people is closer to the average compared to the height of their parents. So a tall person will have tall children but less extremely tall (in tendency, some will of course be even taller). So confusingly, regression literally means "going back".

Re: Linear Regression

#42

This article had a brutal leap from being aimed at someone with barely any understanding of maths (complete with friendly emojis) to use of cost functions (without any explanation) and associated code. It's bit like the "how to draw an owl" meme. A good article on linear regression, in my opinion, would break it down into three steps: 1. Spend a bit of time looking at cost functions. In principle linear regression is…

> that's really the most obvious cost function

To me Deming regression is the most obvious. It actually took me a long time to realize that x~y and y~x are in most cases different lines.

Re: Linear Regression

#43
Why do people write or even read posts like this. You can crack open any stats textbook and it will be explained there in much more detail by someone likely far more qualified to be talking about it.

Feels like some mix of SEO-farming/resume-building-blogspam.

Re: Linear Regression

#44

Why do people write or even read posts like this. You can crack open any stats textbook and it will be explained there in much more detail by someone likely far more qualified to be talking about it. Feels like some mix of SEO-farming/resume-building-blogspam.

people write the articles to cement the knowledge in their own minds. i have no idea why people read them (let alone post them here).

Re: Linear Regression

#45
The discussion here suggests that a lot of developers are jumping right into the middle of data science from a machine learning perspective without a solid understanding of what I would call basic math. It's a lot easier to succeed and compete with a solid grasp of linear algebra, calculus and numerical methods. My personal experience is that curriculum takes a good couple years to really get your head around.

For my current project I had to really understand the closed-form solution for linear regression and even it looks straightforward on paper it really took a while to sink in.

Re: Linear Regression

#48
post #37

Earlier quoted context omitted.

Depends on the tradition you are coming from. In machine learning it really is just that. A synonym for continuous-valued function approximation based on training data. You may say it's only regression if it fits your favorite framework, like giving confidence values or goodness of fit etc, but that's not true in general. There so many variants, like Bayesian probabilistic regression, nonparametrics, neural nets, ran…

> Depends on the tradition you are coming from. Statistics :)

Yes, the statistics and machine learning research communities traditionally have a very different view of the world, of what is important, what is superfluous, but lately the two are more and more merging.

Re: Linear Regression

#50

Two comments here, and I am sorry if they come across as mean: 1) I know this article isn't aimed at me, but I do truly hate the excessive emojis. 2) More substantively: not once does the word "statistics" enter here. There is not a single illustration of the idea behind linear regression, which is staggeringly simple: it is just finding the best linear fit. Anyone who looks at a 2D scatterplot can do an approximate…

Stats are important, but aren't they somewhat excessive for explaining the "idea behind linear regression"? It's neat that this implementation is an unbiased estimator in the presence of gaussian noise, but statistical reasoning seems wholly unnecessary for getting _some_ line of best fit.

I bet somebody could write an article much like this and gloss over most (maybe all?) of the math:

1) Here's a 2D scatterplot, and we want a line that kind of follows the dots.

2) If the data were on a line, this function (sum of the y values subtracted from a linear prediction) would be 0.

2a) Maybe introduce squaring here, but it might seem a little magical and unnecessary, so perhaps wait to introduce pathologies or other reasons till after an implementation of some kind.

3) The scatterplot obviously doesn't fall on a line, but let's try to get as close to 0 as we can. Picking random parameters seems good enough for an introduction to linear regression -- certainly not as efficient in the limit as gradient descent, but it requires next to no code or math to explain what we're doing to a new student.

Future directions and blog posts) Other optimization algorithms, closed forms, why we care about squaring, other functions that work in addition to squaring, and now that we have a good idea of how linear regression might work let's add some statistical reasoning.

Post reply on HN