0
$\begingroup$

I always use Linearregression() class in sklearn library for creating a linear regression model. According to my understanding, we need feature scaling in linear regression when we use Stochastic gradient descent as a solver algorithm, as feature scaling will help in finding the solution in less number of iterations, so with sklearn.linear_model.SGDRegressor() we need to scale the input. However, we dont need to scale the input with Linearregression() as it uses the closed form solution ( based on minimizing the sum of squared residuals). So my first question is, is my understanding correct ? Now my second question is, I need to understand in details why exactly feature scaling will not help if we uses Linearregression() ?

$\endgroup$

1 Answer 1

3
$\begingroup$

@AAA, Yes, your understanding is correct.

Answer to your second question:

  • LinearRegression() uses Normal Equation i.e. closed-form solution to get best parameters for a given solution. Hence, we don’t have iterative loops to find best solution. Therefore, feature scaling is not recommended. Whereas, algorithms that use gradient decent, scaling is recommended.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.