text_plain_output_1.png
from sklearn.linear_model import ElasticNet

from sklearn.model_selection import GridSearchCV

from sklearn.preprocessing import StandardScaler

from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()

scaled_X_train = scaler.fit_transform(X_train)
scaled_X_test = scaler.transform(X_test)

from sklearn.linear_model import ElasticNet
basic_elastic_model = ElasticNet(max_iter=1000000)
param_grid = {'alpha': [100, 120, 130, 140, 200], 'l1_ratio': [0.1, 0.7, 0.99, 1]}

from sklearn.model_selection import GridSearchCV
grid_model = GridSearchCV(estimator=basic_elastic_model, param_grid=param_grid, scoring='neg_mean_squared_error', cv=5, verbose=1)

grid_model.fit(scaled_X_train, y_train)