Question 1
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)
print(model.coef_)What are the coefficients of the model?
[0, 1, 1]
[0, 2, 1]
[0, 0, 1]
[0, 0, 2]