Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1. Linear regression using the diabetes data set [1]: import numpy as np from sklearn import datasets, linear_model import matplotlib.pyplot as plt # Load

image text in transcribed
Problem 1. Linear regression using the diabetes data set [1]: import numpy as np from sklearn import datasets, linear_model import matplotlib.pyplot as plt \# Load the diabetes dataset diabetes_ x, diabetes y= datasets.load_diabetes (return_x_y=True) (a) Print the number of data instances and features in this data set. (b) Use the third feature as the only input feature and split the data into traininglesting sets. (c) Create a linear regression model and fit it to the training data. (d) Predict outputs for the testing data set. (e) Find the weight and intercept values and print them. (f) Plot the test data points using pltscatter and draw the "line of best fit" using plt.plot(). (g) Select two suitable evaluation metrics and report the generalization error using the test data set. (h) Do we get a better model if we use all input features instead of one? You can repeat the training/evaluation process to verify

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions