1from sklearn.linear_model import Lasso
2from sklearn.preprocessing import MinMaxScaler
3scaler = MinMaxScaler()
4
5X_train, X_test, y_train, y_test = train_test_split(X_data, y_data,
6 random_state = 0)
7
8X_train_scaled = scaler.fit_transform(X_train)
9X_test_scaled = scaler.transform(X_test)
10
11linlasso = Lasso(alpha=2.0, max_iter = 10000).fit(X_train_scaled, y_train)
12