-3

I have my data already standardized with the help of StandardScaler() in Python. while applying Lasso Regression do I need to set the normalize parameter True or not and why?

from sklearn import StandardScaler()
scaler=StandardScaler()
x_new=scaler.fit_transform(x)

Now, i want to use Lasso Regression.

from sklearn.linear_model import Lasso
lreg=Lasso(alpha=0.1,max_iter=100,normalize=True)

I want to know if 'normalize=True' is still needed or not?

Vatsal Gupta
  • 471
  • 3
  • 8

1 Answers1

1

Standarize and Normalize are two different actions. If you do both without knowing what they do and why you do it, you'll end up loosing accuracy.

Standarization is removing the mean and dividing by the deviation. Normalization is putting everything between 0 and 1.

Depending on the penalisation (lasso,ridge, elastic net) you'll prefer one over the other, but it's not recommended to to do both.

So no, it's not needed.

Frayal
  • 2,117
  • 11
  • 17