Search Header Logo
ML Week 5

ML Week 5

Assessment

Presentation

Computers

Professional Development

Medium

Created by

Deep Nets

Used 2+ times

FREE Resource

10 Slides • 5 Questions

1

ML Week 5

Linear Regression with Multiple Variables

Slide image

2

Poll

Attendance

Present

Absent

3

Overview of training an ML model

4

1. Initialisation

Initialise the parameters (thetas), so that you have a hypothesis

Slide image

5

2. Calculate cost

Calculate (plot) the cost function of the hypothesis


a. gives an indication of how good or how bad the hypothesis is


b. helps gradient descent take the next step.

Slide image

6

2. Calculate cost

Calculate (plot) the cost function of the hypothesis


a. gives an indication of how good or how bad the hypothesis is


b. helps gradient descent take the next step.

Slide image

7

3. Gradient descent

Take one step of gradient descent towards lowering the cost, which will give you new updated parameters.

Slide image

8

3. Gradient descent

Take one step of gradient descent towards lowering the cost, which will give you new updated parameters.

Slide image

9

4. Update parameters

Update the hypothesis with the new parameters

Slide image

10

4. Repeat steps 2 - 4

1. Calculate cost for the updated hypothesis

2. Take one step gradient descent

3. Update parameters to create a new hypothesis

Slide image

11

Linear Regression with Multiple Variables

12

Multiple Choice

Question image

In the training set shown in the image, what is x1(4)x_1^{\left(4\right)} 

1

The size (in sq. feet) of the 1st home in the training set

2

The age (in years) of the 1st home in the training set

3

The size (in sq. feet) of the 4th home in the training set

4

The age (in years) of the 4th home in the training set

13

Multiple Choice

Suppose you are using a learning algorithm to estimate the price of houses in a city. You want one of your features xix_i to capture the age of the house. In your training set, all of your houses have an age between 30 and 50 years, with an average age of 38 years. Which of the following would you use as features, assuming you use feature scaling and mean normalization?

1

 xi=age of housex_i=age\ of\ house  

2

 xi=age of house50x_i=\frac{age\ of\ house}{50}  

3

 xi=age of house 3850x_i=\frac{age\ of\ house\ -38}{50}  

4

 xi=age of house 3820x_i=\frac{age\ of\ house\ -38}{20}  

14

Multiple Choice

Question image

Suppose a friend ran gradient descent three times, with α=0.01, α=0.1, and α=1, and got the following three plots, labeled A, B, and C (in the image) :

1

A is α=0.01, B is α=0.1, C is α=1.

2

A is α=0.1, B is α=0.01, C is α=1.

3

A is α=1, B is α=0.01, C is α=0.1.

4

A is α=1, B is α=0.1, C is α=0.01.

15

Multiple Choice

Suppose you want to predict a house's price as a function of its size. Your model is hθ(x)=θ0+θ1(size)+θ2(size)h_{\theta}\left(x\right)=\theta_0+\theta_1\left(size\right)+\theta_2\sqrt{\left(size\right)} 
Suppose size ranges from 1 to 1000 (sq. feet). You will implement this by fitting a model hθ(x)=θ0+θ1x1+θ2 x2h_{\theta}\left(x\right)=\theta_0+\theta_1x_1+\theta_2\ x_2 
Finally, suppose you want to use feature scaling (without mean normalization). Which of the following choices for x1x_1 and x2x_2 should you use? (Note:  100032\sqrt{1000}\approx32  )

1

 x1=size, x2=32(size)x_1=size,\ x_2=32\sqrt{\left(size\right)}  

2

 x1=32(size), x2=(size)x_1=32\left(size\right),\ x_2=\sqrt{\left(size\right)}  

3

 x1=size1000, x2=(size)32x_1=\frac{size}{1000},\ x_2=\frac{\sqrt{\left(size\right)}}{32}  

4

 x1=size32, x2=(size)x_1=\frac{size}{32},\ x_2=\sqrt{\left(size\right)}  

ML Week 5

Linear Regression with Multiple Variables

Slide image

Show answer

Auto Play

Slide 1 / 15

SLIDE