text_plain_output_1.png
from sklearn.linear_model import LinearRegression

from sklearn.metrics import r2_score

(X_train.shape, X_test.shape, y_train.shape, y_test.shape)

from sklearn.linear_model import LinearRegression
regressor = LinearRegression()
regressor.fit(X_train, y_train)

y_pred = regressor.predict(X_test)

from sklearn.metrics import r2_score
print('R2 Score', r2_score(y_test, y_pred))