Linear regression with SGDRegressor

For exercise that estimates medical charges for smokers,
if I do it with LinearRegression, model seems to be right, but when I use SGDRegressor instead, graph looks weird, but has same RMSE.
Does anyone have same issue? and I have different graphs with same RMSE every time I run it with SGDRegressor, whereas LinearRegression function always gives me the same result. Did I do something wrong?

1 Like

When I execute SGD regression for non-smoker dataset it’s improved compare with LR.
However SGD giving weird results in Smoker dataset.

in my case for non smoker data the SGD is giving rmse of $5115 but if i check for the values of w and b that i got from linear regression () i get the same rmse for SGD and LR i.e 4662.

you also get weird results from SGD for smoker dataset with only one feature (age), although SGD and LinearRegression give same rmse right?

As long as we have same rmse, are we okay with that graphs they are giving are totally different? Also does your rmse value keeps changing for SGD every time you run it?

no it remains to be same

in smoker category the graph is somewhat having to lines

Hey, you can check this forum post by @tanyachawla to know more about LinearRegression SGDRegressor:

That’s pretty clear. Thanks!

1 Like