image_output_1.png
from sklearn.linear_model import Lasso

from sklearn.linear_model import LinearRegression

from sklearn.metrics import mean_absolute_error , r2_score , mean_squared_error

import numpy as np

from sklearn.linear_model import LinearRegression
Lr = LinearRegression()
Lr.fit(X_train, y_train)
Lr.score(X_test, y_test)

from sklearn.linear_model import Lasso
LO = Lasso()
LO.fit(X_train, y_train)
LO.score(X_test, y_test)

print('Test RMSE', np.sqrt(mean_squared_error(y_test, LO.predict(X_test))))
print('Train RMSE', np.sqrt(mean_squared_error(y_train, LO.predict(X_train))))
print('R2 Test', r2_score(y_test, LO.predict(X_test)))