image_output_1.png
from sklearn.linear_model import LinearRegression

from sklearn.linear_model import LinearRegression

from sklearn.linear_model import LinearRegression

from sklearn.preprocessing import PolynomialFeatures

import matplotlib.pyplot as plt

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

y_pred = regressor.predict(X_test)

from sklearn.preprocessing import PolynomialFeatures
poly_reg = PolynomialFeatures(degree=2)
X_poly = poly_reg.fit_transform(X_train1)
lin_reg_2 = LinearRegression()
lin_reg_2.fit(X_poly, y_train1)

valtopredictn2 = y_test1.reshape(-1, 1)
y_pred3 = lin_reg_2.predict(poly_reg.fit_transform(valtopredictn2))

mean_squared_error(y_test1, y_pred3)