Question: Requirement 1.Check the API of polynomial features (https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.ht ml)and make sure you know how it works. 2. Transfer your data to polynomial order 0.(hint you
Requirement 1.Check the API of polynomial features (https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.ht ml)and make sure you know how it works. 2. Transfer your data to polynomial order 0.(hint you might need to use numpy.reshape() to reshape your data to the proper dimension.) 3. Train a linear regression model using your polynomial order 0 data. 4. Test your model on test data. (hint: remember that feature extraction applies to both training and testing data!) 4. Plot the model prediction over the figure you plotted in task2. It should be something like 5. Try the polynomial order of 1,3, and 9 and repeat steps 24 to plot the corresponding model. Now you should have the entire figure 1.4 from the textbook
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
