Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Third International Conference Achids 2011 Daegu Korea April 2011 Proceedings Part 2 Lnai 6592

Authors: Ngoc Thanh Nguyen ,Chong-Gun Kim ,Adam Janiak

2011th Edition

3642200419, 978-3642200410

More Books

Students also viewed these Databases questions

Question

List three reasons why a merchandising firm holds inventory.

Answered: 1 week ago

Question

Can workers be trained in ethics? How? Defend your answer.

Answered: 1 week ago