Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a randon one dimensional dataset x = np . arange ( 0 , 1 0 0 ) y = x + np . random.rand

Create a randon one dimensional dataset
x = np.arange(0,100)
y = x + np.random.rand(100)*30
plt.scatter(x,y)
Problem 1
a) Fit a regression line on the dataset created above using sklearn.linear_model LinearRegression, use default hyperparameters
b) Print out the regression intercept and coefficients
c) Plot the data in blue and the regression line in red
d) Predict the y value for x=45 and show it on the plot in green.
Problem 2
a) Fit a regression line on the dataset created above using tensorflow and keras, use default hyperparameters, sequential model, one dense neuron, activation='linear'. Use 'rmsprop' optimizer and mean squared error for the loss function. Use 1000 epochs.
b) Print out the regression intercept and coefficients
c) Plot the data in blue and the regression line in red
d) Predict the y value for x=45 and show it on the plot in green
e) Print the coefficients in the keras model and compare to the scikit learn modelen

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 Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

1.Which are projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

Make efficient use of your practice time?

Answered: 1 week ago