Linear regression

Linear regression

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel\(\rightarrow\)Restart) and then run all cells (in the menubar, select Cell\(\rightarrow\)Run All).

Make sure you fill in any place that says YOUR CODE HERE or “YOUR ANSWER HERE”, as well as your name and collaborators below:

NAME = ""
COLLABORATORS = ""

Step 1

Download the data at Pontius.dat. Use numpy.polyfit to fit a second order polynomial. Show the coefficients and a plot. Discuss why you think the fit is reasonable.

Step 2

Use sklearn to fit a second order polynomial to this data. Compare your results to the results you got with numpy.

When you are done, download a PDF and turn it in on Canvas. Make sure to save your notebook, then run this cell and click on the download link.

%run ~/s24-06642/s24.py
%pdf