Question 3
Given the following code for Polynomial Regression:
from sklearn.preprocessing import PolynomialFeaturesfrom sklearn.linear_model import LinearRegressionimport numpy as np
X = np.array([1, 2, 3, 4, 5]).reshape(-1, 1)y = np.array([1, 4, 9, 16, 25])
poly = PolynomialFeatures(degree=2, interaction_only=False)X_poly = poly.fit_transform(X)model = LinearRegression()model.fit(X_poly, y)
y_pred = model.predict(X_poly)print(y_pred)What will be the output of the code?