Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment, you need to build a linear regression model from scratch and optimize the linear regression model using the gradient descent algorithm. Below

For this assignment, you need to build a linear regression model from scratch and optimize the linear regression model using the gradient descent algorithm. Below is a detailed instruction on what you may need to do. Dataset Preparation o Youneedtoloadthedatasetusingsklearn.datasets.load_diabetes. More information about the function can be found at: https://scikit- learn.org/stable/modules/generated/sklearn.datasets.load_diabetes.html#sklearn.d atasets.load_diabetes o Afterloadingthedataset,randomlyshufflethedatasettosplitthedatasettotrain/dev/test sets. Use the 70% of data for the train set, 15% for the dev set, and 15% for the test set Make sure that the labels and features are still matching after shuffling the data. You may want to use the random shuffle function provided by NumPy. Linear Regression Development o Implementasingle-variablelinearregressionmodelfromscratch. o Useagradientdescentalgorithmtosolvetheoptimalparametersforthelinearregression model. The gradient descent algorithm must be implemented from scratch. No high-level libraries can be used. Using online reference and tutorials are allowed. o Thedatasetcontains10features;however,forasingle-variablelinearregressionmodel, you may only use one feature. Thus, to build the linear regression model, you need to decide which feature to you. There are three approaches you may use: You may train 10 single-variable linear regression models, one model for each feature, and select the one with the best performance on the dev set. You may run a feature selection algorithm to select a feature. There are plenty of feature selection algorithms available. Feel free to search on the internet and use a method at your choice. You may use PCA for dimension reduction to reduce the number of features to 1. There are many python libraries that provide PCA algorithms you may use. In fact, scikit-learn also has a PCA function. Feel free to search on the internet and choose one at your choice. Test the Model o Testthemodelusingthetestset.

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_2

Step: 3

blur-text-image_3

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

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

Students also viewed these Databases questions

Question

4. Describe phases of majority identity development.

Answered: 1 week ago