Live data from Hacker News

Logistic regression from scratch

philippmuens.com

61–65 of 65 posts

Re: Logistic regression from scratch

#61
post #60
post #57

Earlier quoted context omitted.

You don't want to demean your dependent (response) binary variable. So you almost always want to keep beta0 to control for any imbalance in your dependent var.

I meant demeaning the independent variables. My understanding is that the beta_0 will have the meaning the curiousgal attach it only if you demean your independent variables.

I see. But I think after demeaning X, beta0 will just have a special meaning... log odds of the average case. Nothing more.

Re: Logistic regression from scratch

#62

Earlier quoted context omitted.

Logistic regression can use both L1 and L2 regularization

And ols can too. That doesn't make it machine learning. This implementation doesn't involve any regularization.

I am not really sure why you are trying to redefine the term machine learning with random references to regularization. OLS is taught in every machine learning course. The machine learns parameters via gradient descent for a wide variety of loss functions.

Re: Logistic regression from scratch

#63
post #58
post #46

Earlier quoted context omitted.

Is that what some people call the 'mansplain' method?

no. all explanations must make some assumption about what readers already know, or else every explanation would begin with teaching english. also, mansplaining generally refers to assuming people (women, usually) have less pre-existing knowledge than they actually do.

Thanks for clarifying. So condescending is not necessarily mansplaining. But mansplaining IS condescending.

Re: Logistic regression from scratch

#64

Earlier quoted context omitted.

I'm trying to have a conversation so I can figure it out. Pretty confident that being a classifier does not make it machine learning, econometrics has classifiers too. Econometric models also need data to train them, so I'm not sure your second point is helpful either. Unless you're claiming the difference is nothing but whether the model is used by an economist.

What is machine learning then?

Statistics as practiced by computer scientists :)

More generally, I recommend Breiman's two cultures article for some insight into the similarities and differences.

If you need a really simple explanation, then machine learning is a tool for generating predictions, while statistics is a method for performing inference about causes.

Re: Logistic regression from scratch

#65
post #48

Earlier quoted context omitted.

Well, then I am gonna say it's even better to think of linear and logistic regression as special case of M Estimators or GMM. Joke aside, the truth is that logistic regression can be understood based on several assumptions. Above we have the latent variable explanation. Then there is a Bayesian version. There's even a "random utlity" formulation, where one models explicitly choices of an agent with a probabilistic er…

The main benefit of the GLM formulation is the observation that your model implies a particular probability distribution for the target, whether you like it or not. And that your point predictions are in fact conditional means . In my opinion, this is an important aspect of modeling that is glossed over or omitted by a lot of introductory material.

I agree on the point of conditional means, however I'd say other statistical frameworks emphasize that point even more.

The point about the probability distribution is reasonable, but I am not sure if it is taken seriously by everyone applying GLM either. And again, if it is not necessary to assume such a distribution, then I would prefer a semi parametric approach, such as in linear regression.

Post reply on HN