Question: Question 1 ( 5 0 ) This data set of size n = 1 5 ( Yield data ) contains measurements of yield from an

Question 1(50)
This data set of size n=15(Yield data) contains
measurements of yield from an experiment
done at different temperature levels. The
variables are y= yield and x= temperature in
degrees Fahrenheit. The table below gives the
data used for this analysis
Use data points {1,4,7,10,13} as the validation
and remaining as the training set
a. Use the given Python code to find different polynomial regression functions for degrees
M={1,3,5,10,15} for the training set dataset.
import numpy as np
m=1 # degree of the polynomial regression function
mymodel =n p.polyld(np.polyfit (x,y,1)
b. Plot each function with the following code
plt.scatter(x, y)
myline = np.linspace (40,110,100)
plt.plot (myline, mymodel (myline))
plt.show ()
c. Get coefficient of the models with this function
print (mymodel.coefficients)
d. Calculate the cost for training dataset and also for the validation set with learned regression
models. Use the cost equation that we learned in the class.
e. Decide which model is better to select and explain your answers.
 Question 1(50) This data set of size n=15(Yield data) contains measurements

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 Databases Questions!