Cost function formula Flashcards

1
Q

Q: What is the first key step in implementing linear regression?

A

A: Defining the cost function to measure how well the model is doing.

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

Q: What do the parameters w and b represent in the linear regression model?

A

A: w is the weight (slope), and b is the bias (intercept).

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

Q: How do different values of w and b affect the linear regression model’s function f(x)?

A

A: They change the slope and position of the line on the graph.

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

Q: What is the function f in linear regression commonly called?

A

A: The model.

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

Q: How do you write a linear regression function using w and b?

A

A: f(x)=wx+b.

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

Q: What do you call the difference between the predicted value y^ and the actual value y?

A

A: The error.

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

Q: How is the cost function J(w,b) defined in linear regression?

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

Q: What is meant by “squared error” in the cost function?

A

A: It is the square of the difference between the predicted value y^ and the true value y.

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

Q: Why do we divide by 2m in the cost function formula?

A

A: For mathematical convenience and to simplify further calculations.

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

Q: What is the goal when minimizing the cost function J(w,b)?

A

A: To find values of w and b that make the cost function as small as possible, indicating a better fit to the data.

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

Q: How do you denote a specific training example in machine learning notation?

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

Q: What happens if J(w,b) is large?

A

A: It indicates that the model’s predictions are far from the actual values, reflecting poor performance.

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

Q: What does a small value of J(w,b) indicate?

A

A: That the model’s predictions are close to the actual values, indicating good performance.

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

Q: How does the cost function help in the optimization process of linear regression?

A

A: It provides a quantitative measure of the model’s error, guiding adjustments to w and b to improve predictions.

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

Q: What is the goal of the cost function in linear regression?

A

A: To measure how well the model’s predictions match the actual data and to help improve the model by adjusting the parameters.

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

Q: What does f(x)=wx+b represent in linear regression?

A

A: It represents the linear model where w is the slope and b is the intercept.

17
Q

Q: What do the parameters w and b represent in the linear regression model?

A

A: w is the weight (slope), and b is the bias (intercept).

18
Q

Q: What happens when the parameter w changes in the linear regression model?

A

A: It changes the slope of the line, resulting in different straight lines on the graph.

19
Q

Q: How do you calculate the cost function J(w,b)?

A
20
Q

Q: What does y^ represent in the context of the cost function?

A

A: The predicted value of y by the model.

21
Q

Q: Why do we use the squared error in the cost function?

A

A: To measure how far off the predictions are from the targets and to ensure that larger errors are penalized more heavily.

22
Q

Q: What is the goal when minimizing the cost function J(w,b)?

A

A: To find the values of w and b that make the cost function as small as possible, indicating a good fit to the data.

23
Q

Q: How does the simplified model f(x)=wx differ from f(x)=wx+b?

A

A: The simplified model sets b to 0, resulting in a line that always passes through the origin.

24
Q

Q: What does the graph of fw(x) show when plotted?

A

A: It shows the relationship between the input feature x and the output y with the line’s slope defined by w.

25
Q

Q: What does the graph of the cost function J(w) show?

A

A: It shows how the cost varies with different values of the parameter w.

26
Q

Q: When plotting f(x) and J(w) side-by-side, what relationship can be observed?

A

A: Changes in the slope w of f(x) directly affect the calculated cost J(w).

27
Q

Q: How does negative w affect the cost function?

A

A: Negative values of w result in downward-sloping lines and typically higher costs for this dataset.

28
Q

Q: What is the end goal of linear regression regarding the cost function?

A

A: To find the parameters w and b that minimize the cost function J, ensuring the best fit of the model to the data.