1. Home
  2. Explore
  3. Mathematics
  4. Gradient Descent

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Gradient Descent

  • 46Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Core Concepts

What is the primary purpose of Gradient Descent in statistical and machine-learning models?

46 questions

  1. 1

    What is the primary purpose of Gradient Descent in statistical and machine-learning models?

    1. A

      To transform all variables into standardized measurement units

    2. B

      To determine whether a data set follows a normal distribution

    3. C

      To divide a data set into training and testing subsets

    4. D

      To optimize parameter values by minimizing a loss function

    Correct answer
    D

    To optimize parameter values by minimizing a loss function

    Explanation

    Gradient Descent optimizes model parameters by iteratively changing them to reduce a loss function.

  2. 2

    Which quantities are optimized when fitting a line with ordinary linear regression?

    1. A

      The residuals and the sample size

    2. B

      The weights and the classification threshold

    3. C

      The mean and the standard deviation

    4. D

      The intercept and the slope

    Correct answer
    D

    The intercept and the slope

    Explanation

    Fitting a linear regression line involves finding optimal values for its intercept and slope.

  3. 3

    According to the content, what does logistic regression optimize?

    1. A

      A nonlinear decision boundary or curve

    2. B

      A fixed set of clusters in the predictor space

    3. C

      A collection of unrelated regression lines

    4. D

      The number of observations in each category

    Correct answer
    A

    A nonlinear decision boundary or curve

    Explanation

    The content describes logistic regression as optimizing a curved, or “squiggle,” relationship.

  4. 4

    What does t-SNE optimize according to the examples provided?

    1. A

      Clusters

    2. B

      Regression slopes

    3. C

      Residual variances

    4. D

      Classification thresholds

    Correct answer
    A

    Clusters

    Explanation

    The content identifies clusters as the structures optimized by t-SNE.

  5. 5

    Why can learning Gradient Descent for fitting a line help with other optimization problems?

    1. A

      Linear regression automatically produces solutions for nonlinear models

    2. B

      Every model has only one parameter to optimize

    3. C

      The same general optimization strategy applies to many parameterized models

    4. D

      All statistical models use exactly the same loss function

    Correct answer
    C

    The same general optimization strategy applies to many parameterized models

    Explanation

    Gradient Descent uses a general strategy that can optimize many different objectives and models, not just lines.

  6. 6

    In the example data set, which variable is placed on the xxx-axis and which is placed on the yyy-axis?

    1. A

      Height is on the xxx-axis and weight is on the yyy-axis

    2. B

      Intercept is on the xxx-axis and height is on the yyy-axis

    3. C

      Weight is on the xxx-axis and height is on the yyy-axis

    4. D

      Residual is on the xxx-axis and weight is on the yyy-axis

    Correct answer
    C

    Weight is on the xxx-axis and height is on the yyy-axis

    Explanation

    The example uses weight as the predictor on the xxx-axis and height as the response on the yyy-axis.

  7. 7

    Using the fitted line in the example, what height is predicted for a person whose weight is 1.51.51.5?

    1. A

      Approximately 0.640.640.64

    2. B

      Approximately 1.51.51.5

    3. C

      Approximately 0.950.950.95

    4. D

      Approximately 1.91.91.9

    Correct answer
    D

    Approximately 1.91.91.9

    Explanation

    The example states that the fitted line predicts a height of approximately 1.91.91.9 for a weight of 1.51.51.5.

  8. 8

    Why is an initial random parameter value used in Gradient Descent?

    1. A

      It determines the number of data points used in training

    2. B

      It guarantees that the first model is already optimal

    3. C

      It gives the algorithm a starting point that it can improve

    4. D

      It removes the need to calculate a loss function

    Correct answer
    C

    It gives the algorithm a starting point that it can improve

    Explanation

    The initial value is only a starting guess; Gradient Descent uses subsequent updates to improve it.

  9. 9

    What loss function is used in the one-parameter example?

    1. A

      The average of the predictor values

    2. B

      The product of the residuals

    3. C

      The sum of the squared residuals

    4. D

      The absolute value of the intercept

    Correct answer
    C

    The sum of the squared residuals

    Explanation

    The fit is evaluated using the sum of the squared residuals, which is a type of loss function.

  10. 10

    How is a residual defined in the example?

    1. A

      The observed weight minus the predicted weight

    2. B

      The observed height minus the predicted height

    3. C

      The slope minus the intercept

    4. D

      The predicted height minus the weight

    Correct answer
    B

    The observed height minus the predicted height

    Explanation

    A residual is the difference between an observed response and its predicted value.

  11. 11

    With slope 0.640.640.64 and intercept 000, what height is predicted for a person with weight 0.50.50.5?

    1. A

      1.401.401.40

    2. B

      0.500.500.50

    3. C

      1.141.141.14

    4. D

      0.320.320.32

    Correct answer
    D

    0.320.320.32

    Explanation

    Using y=b0+b1xy = b_0 + b_1xy=b0​+b1​x, the prediction is 0+0.64(0.5)=0.320 + 0.64(0.5) = 0.320+0.64(0.5)=0.32.

  12. 12

    For the person with observed height 1.41.41.4 and predicted height 0.320.320.32, what is the residual?

    1. A

      0.320.320.32, approximately 0.30.30.3

    2. B

      0.640.640.64, approximately 0.60.60.6

    3. C

      1.721.721.72, approximately 1.71.71.7

    4. D

      1.081.081.08, approximately 1.11.11.1

    Correct answer
    D

    1.081.081.08, approximately 1.11.11.1

    Explanation

    The residual is 1.4−0.32=1.081.4 - 0.32 = 1.081.4−0.32=1.08, reported approximately as 1.11.11.1.

  13. 13

    What is the sum of the squared residuals for the initial line in the example?

    1. A

      1.91.91.9

    2. B

      0.640.640.64

    3. C

      3.13.13.1

    4. D

      0.950.950.95

    Correct answer
    C

    3.13.13.1

    Explanation

    After squaring and summing the three residuals, the example obtains a loss of 3.13.13.1.

  14. 14

    On the graph of the loss function for the intercept, what does the horizontal axis represent?

    1. A

      Different values of the slope of the loss curve

    2. B

      Different observed heights

    3. C

      Different values of the intercept

    4. D

      Different numbers of residuals

    Correct answer
    C

    Different values of the intercept

    Explanation

    The graph plots the sum of squared residuals against candidate intercept values.

  15. 15

    Why is plugging in many possible intercept values considered inefficient for finding the minimum loss?

    1. A

      It cannot calculate residuals for any candidate intercept

    2. B

      It always produces a slope of exactly zero

    3. C

      It changes the observed heights whenever the intercept changes

    4. D

      It requires many calculations and may miss the best value between tested values

    Correct answer
    D

    It requires many calculations and may miss the best value between tested values

    Explanation

    A plug-and-chug search can be slow and may fail to evaluate values between the chosen candidates.

  16. 16

    How does Gradient Descent vary its step sizes as it approaches the optimum?

    1. A

      It uses exactly the same step size throughout

    2. B

      It takes smaller steps when far away and larger steps when close

    3. C

      It chooses step sizes independently of the current location

    4. D

      It takes larger steps when far away and smaller steps when close

    Correct answer
    D

    It takes larger steps when far away and smaller steps when close

    Explanation

    The slope tends to be larger far from the minimum and closer to zero near the minimum, producing larger and smaller updates respectively.

  17. 17

    What does the derivative of the loss function indicate at a particular intercept value?

    1. A

      The predicted height for the first observation

    2. B

      The slope of the loss curve at that intercept

    3. C

      The total number of observations in the data set

    4. D

      The fixed value of the regression slope

    Correct answer
    B

    The slope of the loss curve at that intercept

    Explanation

    The derivative with respect to the intercept gives the slope of the loss curve at that intercept.

  18. 18

    Why is the chain rule needed when differentiating the squared residual terms?

    1. A

      The loss function contains no parameter-dependent terms

    2. B

      The intercept is treated as a categorical variable

    3. C

      Each term is a squared function containing an inner expression involving the parameter

    4. D

      The data contain more than one observation

    Correct answer
    C

    Each term is a squared function containing an inner expression involving the parameter

    Explanation

    The squared residual is a composition of an outer square and an inner residual expression, so the chain rule applies.

  19. 19

    If the derivative at intercept 000 is −5.7-5.7−5.7 and the learning rate is 0.10.10.1, what is the step size?

    1. A

      −5.7-5.7−5.7

    2. B

      −0.57-0.57−0.57

    3. C

      0.0570.0570.057

    4. D

      0.570.570.57

    Correct answer
    B

    −0.57-0.57−0.57

    Explanation

    The step size is the derivative multiplied by the learning rate: −5.7(0.1)=−0.57-5.7(0.1) = -0.57−5.7(0.1)=−0.57.

  20. 20

    Given an old intercept of 000 and a step size of −0.57-0.57−0.57, what new intercept results from the update rule?

    1. A

      −0.57-0.57−0.57

    2. B

      0.570.570.57

    3. C

      0.000.000.00

    4. D

      1.141.141.14

    Correct answer
    B

    0.570.570.57

    Explanation

    The update is new intercept === old intercept −-− step size, so 0−(−0.57)=0.570 - (-0.57) = 0.570−(−0.57)=0.57.

  21. 21

    What happens to the magnitude of the update steps as the intercept approaches its optimal value?

    1. A

      The steps become progressively smaller

    2. B

      The steps remain fixed because the slope is constant

    3. C

      The steps become progressively larger

    4. D

      The steps alternate randomly between large and small values

    Correct answer
    A

    The steps become progressively smaller

    Explanation

    As the intercept approaches the minimum, the derivative approaches zero, so the step sizes decrease.

  22. 22

    After six update steps in the example, what intercept does Gradient Descent estimate?

    1. A

      0.570.570.57

    2. B

      0.950.950.95

    3. C

      1.901.901.90

    4. D

      0.640.640.64

    Correct answer
    B

    0.950.950.95

    Explanation

    After six steps, the Gradient Descent estimate for the intercept is 0.950.950.95.

  23. 23

    How does Gradient Descent differ from directly solving for the least-squares optimum?

    1. A

      Gradient Descent ignores the loss function while least squares minimizes it

    2. B

      Gradient Descent optimizes only predictions while least squares optimizes only residuals

    3. C

      Gradient Descent requires no derivatives while least squares requires many random guesses

    4. D

      Gradient Descent iteratively takes steps instead of directly solving where the derivative equals zero

    Correct answer
    D

    Gradient Descent iteratively takes steps instead of directly solving where the derivative equals zero

    Explanation

    Least squares can find the optimum by setting the derivative to zero, whereas Gradient Descent approaches it through iterative updates.

  24. 24

    What is the role of the learning rate in Gradient Descent?

    1. A

      It specifies the final minimum value of the loss function

    2. B

      It determines the number of parameters in the model

    3. C

      It converts residuals into predicted values

    4. D

      It scales the derivative to control the size of each parameter update

    Correct answer
    D

    It scales the derivative to control the size of each parameter update

    Explanation

    The learning rate is a small multiplier that controls how large the update step is.

  25. 25

    What can happen if the learning rate is too large?

    1. A

      The derivative becomes exactly zero after one update

    2. B

      The model loses all of its parameters

    3. C

      The algorithm automatically uses every data point multiple times

    4. D

      An update can overshoot the minimum and increase the loss

    Correct answer
    D

    An update can overshoot the minimum and increase the loss

    Explanation

    An excessively large step can move past the minimum and make the sum of squared residuals larger.

  26. 26

    In the two-parameter example, why was a smaller learning rate used than in the intercept-only example?

    1. A

      The larger rate failed to lead Gradient Descent to the correct solution

    2. B

      The intercept was held fixed throughout the optimization

    3. C

      The two-parameter model had no differentiable loss function

    4. D

      The slope could not be updated using a learning rate

    Correct answer
    A

    The larger rate failed to lead Gradient Descent to the correct solution

    Explanation

    The content states that the larger learning rate used previously did not produce the correct answer for the two-parameter problem.

  27. 27

    How can a learning rate be selected automatically in practice?

    1. A

      Start with a relatively large rate and decrease it at each step

    2. B

      Choose a new random rate without changing it afterward

    3. C

      Set the rate permanently to the initial loss value

    4. D

      Choose a rate equal to the number of observations

    Correct answer
    A

    Start with a relatively large rate and decrease it at each step

    Explanation

    The content describes an approach that starts with a larger learning rate and gradually reduces it.

  28. 28

    What is one stopping condition used by Gradient Descent?

    1. A

      The intercept becomes exactly equal to zero

    2. B

      The step size becomes sufficiently close to zero

    3. C

      The first residual becomes larger than the observed height

    4. D

      The learning rate becomes equal to one

    Correct answer
    B

    The step size becomes sufficiently close to zero

    Explanation

    Gradient Descent can stop when the update step is very small, indicating that the derivative is near zero.

  29. 29

    Using a minimum step-size threshold of 0.0010.0010.001, should the algorithm stop when the step size is 0.00090.00090.0009?

    1. A

      No, because only the loss value can determine stopping

    2. B

      No, because every step must be larger than the threshold

    3. C

      Yes, but only if the intercept is also exactly zero

    4. D

      Yes, because 0.00090.00090.0009 is smaller than the threshold

    Correct answer
    D

    Yes, because 0.00090.00090.0009 is smaller than the threshold

    Explanation

    With a threshold of 0.0010.0010.001, a step size of 0.00090.00090.0009 is sufficiently small to trigger stopping.

  30. 30

    What additional stopping condition prevents Gradient Descent from running indefinitely?

    1. A

      A requirement that the slope equal the intercept

    2. B

      A maximum number of allowed steps

    3. C

      A minimum number of observations

    4. D

      A maximum possible residual

    Correct answer
    B

    A maximum number of allowed steps

    Explanation

    Gradient Descent also stops after reaching a preset maximum number of steps, even if the step size remains large.

  31. 31

    When optimizing both the intercept and slope, what does the loss function become a function of?

    1. A

      The learning rate and the number of iterations

    2. B

      Only the sample weights

    3. C

      Only the observed heights

    4. D

      Both the intercept and the slope

    Correct answer
    D

    Both the intercept and the slope

    Explanation

    The sum of squared residuals changes according to both the intercept and slope, so the loss is a surface over those two parameters.

  32. 32

    What does the three-dimensional loss-function graph represent?

    1. A

      Predicted heights for three different individuals

    2. B

      Residual values for three different learning rates

    3. C

      Loss values for different combinations of intercept and slope

    4. D

      The derivatives of three unrelated loss functions

    Correct answer
    C

    Loss values for different combinations of intercept and slope

    Explanation

    The three-dimensional graph shows the sum of squared residuals across different intercept and slope combinations.

  33. 33

    When differentiating with respect to the intercept, how is the slope treated?

    1. A

      As a random variable that must be removed from the model

    2. B

      As a constant whose derivative is zero

    3. C

      As the only parameter that can change during the update

    4. D

      As another dependent variable whose derivative is one

    Correct answer
    B

    As a constant whose derivative is zero

    Explanation

    For a partial derivative with respect to the intercept, the slope is held constant.

  34. 34

    When differentiating with respect to the slope, how is the intercept treated?

    1. A

      As a constant whose derivative is zero

    2. B

      As a second slope that must be squared

    3. C

      As the learning rate for the update

    4. D

      As a residual that is added to the loss

    Correct answer
    A

    As a constant whose derivative is zero

    Explanation

    For a partial derivative with respect to the slope, the intercept is held constant.

  35. 35

    Why does the weight 0.50.50.5 appear in the derivative with respect to the slope for the first observation?

    1. A

      It is the residual associated with the first observation

    2. B

      It is the predictor value involved in differentiating the prediction with respect to the slope

    3. C

      It is the learning rate used for the first update

    4. D

      It is the intercept selected for the initial model

    Correct answer
    B

    It is the predictor value involved in differentiating the prediction with respect to the slope

    Explanation

    The derivative of the prediction with respect to the slope includes the observation’s weight, which is 0.50.50.5 for the first sample.

  36. 36

    What is a gradient when several derivatives of the same function are considered together?

    1. A

      The average of all observed response values

    2. B

      A collection of partial derivatives, one for each parameter

    3. C

      A fixed learning rate shared by all models

    4. D

      The single residual with the largest absolute value

    Correct answer
    B

    A collection of partial derivatives, one for each parameter

    Explanation

    The gradient consists of the derivatives of the loss function with respect to its parameters.

  37. 37

    Why is the algorithm called Gradient Descent?

    1. A

      It increases every parameter whenever the loss increases

    2. B

      It uses the gradient to move toward lower values of the loss function

    3. C

      It descends through the rows of the data set in a fixed order

    4. D

      It calculates only derivatives that are positive

    Correct answer
    B

    It uses the gradient to move toward lower values of the loss function

    Explanation

    The gradient indicates how the loss changes, and the algorithm uses it to move toward the loss function’s lowest point.

  38. 38

    In the two-parameter example, what initial values were selected for the intercept and slope?

    1. A

      Intercept 111 and slope 000

    2. B

      Intercept 0.950.950.95 and slope 0.640.640.64

    3. C

      Intercept 000 and slope 111

    4. D

      Intercept 0.640.640.64 and slope 0.950.950.95

    Correct answer
    C

    Intercept 000 and slope 111

    Explanation

    The example begins with an intercept of 000 and a slope of 111.

  39. 39

    How are the intercept and slope updated in the two-parameter version of Gradient Descent?

    1. A

      Each is replaced by its derivative plus the learning rate

    2. B

      Each is replaced by its old value minus its corresponding step size

    3. C

      Both are replaced by the average of their current values

    4. D

      Only the intercept is updated while the slope remains fixed

    Correct answer
    B

    Each is replaced by its old value minus its corresponding step size

    Explanation

    Each parameter receives its own derivative-based step size and is updated using old parameter minus step size.

  40. 40

    What final intercept and slope does the example obtain using Gradient Descent?

    1. A

      Intercept 0.950.950.95 and slope 0.640.640.64

    2. B

      Intercept 000 and slope 111

    3. C

      Intercept 1.91.91.9 and slope 0.50.50.5

    4. D

      Intercept 0.640.640.64 and slope 0.950.950.95

    Correct answer
    A

    Intercept 0.950.950.95 and slope 0.640.640.64

    Explanation

    The best-fitting line has intercept 0.950.950.95 and slope 0.640.640.64, matching the least-squares estimates.

  41. 41

    How does Gradient Descent generalize when a model has more than two parameters?

    1. A

      Use only the derivative of the intercept and ignore the other parameters

    2. B

      Avoid derivatives and search every possible parameter combination

    3. C

      Replace all parameters with a single average parameter

    4. D

      Take additional derivatives and update each parameter in the same general way

    Correct answer
    D

    Take additional derivatives and update each parameter in the same general way

    Explanation

    For more parameters, the algorithm computes more partial derivatives while keeping the same update procedure.

  42. 42

    Which sequence correctly describes the general Gradient Descent procedure?

    1. A

      Differentiate the loss, initialize parameters, compute derivatives, calculate steps, update parameters, and repeat

    2. B

      Calculate residuals, sort observations, remove parameters, and choose the largest loss

    3. C

      Initialize parameters, discard the loss, calculate predictions, and stop after one update

    4. D

      Choose the final parameters, differentiate afterward, and repeat only if the slope is positive

    Correct answer
    A

    Differentiate the loss, initialize parameters, compute derivatives, calculate steps, update parameters, and repeat

    Explanation

    The procedure first obtains the gradient, selects starting parameter values, computes updates, and repeats until a stopping condition is met.

  43. 43

    Why can Gradient Descent be used with loss functions other than the sum of squared residuals?

    1. A

      It applies the same derivative-based update strategy to the chosen loss function

    2. B

      All loss functions produce identical derivatives

    3. C

      Gradient Descent replaces every loss function with squared residuals

    4. D

      Alternative loss functions do not require parameters

    Correct answer
    A

    It applies the same derivative-based update strategy to the chosen loss function

    Explanation

    The loss function can change, but the algorithm still differentiates it and uses the resulting gradient for updates.

  44. 44

    Why can full-batch Gradient Descent become slow with millions of data points?

    1. A

      The loss function can no longer be differentiated

    2. B

      Each update requires calculations involving the full data set

    3. C

      The number of parameters automatically becomes millions

    4. D

      The algorithm must test every possible intercept separately

    Correct answer
    B

    Each update requires calculations involving the full data set

    Explanation

    Using all observations at every step makes calculating the derivatives expensive for very large data sets.

  45. 45

    What does Stochastic Gradient Descent use at each update instead of the full data set?

    1. A

      A fixed data point chosen before training begins

    2. B

      A randomly selected subset of the data

    3. C

      Only the observations with zero residuals

    4. D

      A synthetic data set with no observed responses

    Correct answer
    B

    A randomly selected subset of the data

    Explanation

    Stochastic Gradient Descent calculates each update from a randomly selected subset of observations.

  46. 46

    What is the main computational advantage of Stochastic Gradient Descent?

    1. A

      It reduces the time required to calculate loss-function derivatives

    2. B

      It eliminates the need to choose or adjust a learning rate

    3. C

      It ensures that every update decreases the loss

    4. D

      It guarantees the exact least-squares solution in one step

    Correct answer
    A

    It reduces the time required to calculate loss-function derivatives

    Explanation

    Using a subset rather than the full data set reduces the amount of computation required for each derivative calculation.

Question 1 of 46
Question 1 of 46

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent