Opening the paper…
Machine Learning Practice, Quiz 2
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?
Given the following code for **Polynomial Regression**: from sklearn.preprocessing import PolynomialFeatures from sklearn.linear_model import LinearRegression import 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? What is ‘naive’ assumption in classifiers based on Naive Bayes? Figure from the original question paper