Question: Problem 2 : Load the data set Q consisting of a single explanatory variable ( boldsymbol { x } ) and dependent

Problem 2:
Load the data set Q consisting of a single explanatory variable \(\boldsymbol{x}\) and dependent variable \(\boldsymbol{y}\).
1. Shuffle the rows of \( Q \) and separate the data into a test set and training set. Use \(30\%\) of the data for the testing set and the remaining 70\% for training set.
[42]: Q = np.genfromtxt('dataLS.txt',delimiter=',')
np.random.shuffle\#\#\#\# use polyfit
2. Build 4 different models on the training set, each of different degree polynomials \(\boldsymbol{p}=1,2,3,4\). With each model:
a. Print a graph of the data with a graph of the model. Use blue for training data, red for the testing data and use black for the model.
b. Below the graph, print the model parameters and the mean of the squared error on the testing set.
Problem 2 : Load the data set Q consisting of a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!