$23.99
In this exercise, you will implement regularized linear regression and use it to study models with different bias-variance properties. Before starting on the programming exercise, we strongly recommend watching the video lectures and completing the review questions for the associated topics.
To get started with the exercise, you will need to download the starter code and unzip its contents to the directory where you wish to complete the exercise. If needed, use the cd command in Octave/MATLAB to change to this directory before starting this exercise.
You can also find instructions for installing Octave/MATLAB in the “En- vironment Setup Instructions” of the course website.
Files included in this exercise
ex5.m - Octave/MATLAB script that steps you through the exercise
ex5data1.mat - Dataset
submit.m - Submission script that sends your solutions to our servers
featureNormalize.m - Feature normalization function fmincg.m - Function minimization routine (similar to fminunc) plotFit.m - Plot a polynomial fit
trainLinearReg.m - Trains linear regression using your cost function [?] linearRegCostFunction.m - Regularized linear regression cost func- tion
[?] learningCurve.m - Generates a learning curve
[?] polyFeatures.m - Maps data into polynomial feature space
[?] validationCurve.m - Generates a cross validation curve
? indicates files you will need to complete
Throughout the exercise, you will be using the script ex5.m. These scripts set up the dataset for the problems and make calls to functions that you will write. You are only required to modify functions in other files, by following the instructions in this assignment.
Submission and Grading
After completing various parts of the assignment, be sure to use the submit function system to submit your solutions to our servers. The following is a breakdown of how each part of this exercise is scored.
Part
Submitted File
Points
Regularized Linear Regression Cost
Function
Regularized Linear Regression Gra- dient
linearRegCostFunction.m
linearRegCostFunction.m
25 points
25 points
Learning Curve
learningCurve.m
20 points
Polynomial Feature Mapping
Cross Validation Curve
polyFeatures.m
validationCurve.m
10 points
20 points
Total Points
100 points
You are allowed to submit your solutions multiple times, and we will take only the highest score into consideration.