Beruflich Dokumente
Kultur Dokumente
You are required to form groups of 3 for this Lab assignment. Please email your group
member to Mr. Abdallah Moubayed (amoubaye@uwo.ca). Do not show your code to any
other student and do not look at any other student's code. Do not put your code in any public
domain. Due to the large enrollment in this course we will not be able to answer questions by
email. This assignment has 2 parts.
When you complete your assignment, p le ase submit the r e p o r t a n d t h e source code
using OWL. Although this is a programming assignment, you must comment the code so
that it can be read and understood by another programmer that is not necessarily
experienced with M a t la b o r Python (you may use Matlb or Python for this homework).
Each power generated and temperature tuple constitutes one training example in our dataset. There
are training examples, and you will use them to develop a linear regression model.
Now, we will implement linear regression for this problem. Recall that the linear regression model is
1. Implement gradient descent using a small value of the learning rate. Initialize the parameters to
, and run one iteration of gradient descent from this initial starting point. Record the value
of 𝜃0 𝑎𝑛𝑑 𝜃1 that you get after this first iteration
2. Continue running gradient descent for more iterations until 𝜃 converges. After convergence,
record the final values of 𝜃0 𝑎𝑛𝑑 𝜃1 that you get.
1
When you have found 𝜃 , plot the straight line fit from your algorithm on the same graph as your
training data.
Understanding 𝑱(𝜽)
We'd like to understand better what gradient descent has done, and visualize the relationship between
the parameters and 𝜃 ∈ 𝑅 2 𝑎𝑛𝑑 𝐽(𝜃). In this problem, you have to plot 𝐽(𝜃) as a 3D surface plot.