Regression Model and Terminology Flashcards

(25 cards)

1
Q

What is Linear Regression?

A
  • putting a straight line through data points and derive other outputs for inputs based on that
  • i.e predicting the price of houses based on the size of the houses
  • can have one or more input variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the data called that is used to train the model?

A

Training Set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the input variable notation?

A

x
= input variable
- or feature

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the output variable notation?

A

y
= output or target variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the notation for the number of training sets?

A

m

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does (x,y) mean?

A

a single training example

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what does (x’(i), y’(i)) mean? ‘ means ‘up’

A

the i-th training example

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the flow of training a model and then working with it?

A
  1. Train the model/learning algorithm using the test data
  2. The Model creates a function/hypothesis that takes a x creates an estimation ŷ
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the notation for the prediction of y?

A

ŷ -> y-hat
Estimated value of y

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can we represent f for a linear regression?

A

f_w,b_(X) = wx + b
_ means lower, _ again is normal
Can be shortened to f(x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can linear regression with one variable be also called?

A

Univariate linear regression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does a Cost function tell us?

A
  • how well a model is doing
  • enables us to modify the model to do better
  • takes the prediction ŷ and compares it to y: ŷ - y
  • this is called the error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are w and b called in f_wb(x)? What can they be used for?

A
  • called parameters of the model
  • are the variables used during training to improve the model
  • also called weights / coefficients
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What role have w and b in f_wb(x)?

A
  • b is also called y-intercept as it describes where the line intersects with the y axis
  • w describes the slope of the line
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does the cost function look?

A
  • takes the prediction ŷ and compares it to y: ŷ - y
  • this is called the error
  • J(w,b) = 1/2m * (Sum from i = 1 to m for (ŷ⁽i⁾ - y⁽i⁾)²)
  • m = number of training examples
  • also called the squared cost function
  • most commonly used function for regression and especially linear regression
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can you rewrite the cost function for regression?
J(w,b) = 1/2m * (Sum from i = 1 to m for (ŷ⁽i⁾-y⁽i⁾)²)

A

J(w,b) = 1/2m * (Sum from i =1 to m for (f_w,b(x⁽i⁾) - y⁽i⁾)²)

resolving ŷ with the function for the prediction

17
Q

What is our goal with the cost function?

A
  • find w and b where the cost function is always small
    minimize J(w,b) using w,b
18
Q

How can you simplify the cost function in order to solve the optimal parameter variables?

A

set b = 0
f_w(x) = wx

Cost function becomes: minimize J(w)
J(w) = 1/2m(Sum of i = 1 to m for (f_w(x⁽i⁾) - y⁽i⁾)²)

19
Q

What can you do in order to find the optimum for the cost function?

A

Plot the values of the cost function J(w) with what the squared cost function with the different values for w look like

20
Q

What is a contour plot and how does it help in the context of Cost functions?

A
  • contour plots show in a plane of with varying ws and bs the results of the cost function
  • at the minimum of the contour plot of the cost function you can find the minimum of the cost function
  • this means the optimal values for w and b to minimize the cost function
21
Q

What is Gradient Descent and where is it used?

A
  • algorithm to find the best constellation of w and b to minizime J(w,b) the squared cost function
  • used in machine and deep learning
  • can be used to minimize any function not just cost functions
22
Q

How do you approach Gradient Descend?

A
  • Start with some w, b
  • keep changing w, b to reduce J(w,b)
  • until we settle at or near a minimum
  • with some cost functions there can be more than one minimum
23
Q

How does Gradient Descend work?

A
  • checks for all surrounding value combinations of the parameters (w,b,…) where the direction of steepest descent is
  • repeats this until you cannot find any point of descent around you
  • leads you to local minima depending on where you start
  • both w and b are updated simultaneously
24
Q

What is the Gradient descent algorithm?

A

w = w - Alpha (d/dw)J(w,b)
w is assigned a new value
Alpha -> Learning rate, usually small positive number, controls how big the steps are taken down
(d/dw)*J(w,b) -> derivative of cost function J, in what direction you want to take the baby step

Also
b = b - Alpha (d/db)*J(w,b)

25