forked from rohitg00/ai-engineering-from-scratch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz.json
More file actions
67 lines (67 loc) · 3.1 KB
/
Copy pathquiz.json
File metadata and controls
67 lines (67 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[
{
"id": "linreg-pre-1",
"stage": "pre",
"question": "What does the learning rate control in gradient descent?",
"options": [
"The number of features used by the model",
"How many epochs the model trains for",
"The size of each parameter update step",
"The ratio of training to test data"
],
"correct": 2,
"explanation": "The learning rate is a scalar that controls how much weights change per gradient descent step. Too large causes divergence, too small causes slow convergence."
},
{
"id": "linreg-pre-2",
"stage": "pre",
"question": "What does R-squared = 0 mean for a regression model?",
"options": [
"The model makes perfect predictions",
"The model is no better than always predicting the mean of the target",
"The model has negative error",
"The model has not been trained yet"
],
"correct": 1,
"explanation": "R-squared = 0 means the model explains none of the variance in the target. It performs exactly as well as simply predicting the mean every time."
},
{
"id": "linreg-post-1",
"stage": "post",
"question": "Why is feature scaling important for gradient descent in multiple linear regression?",
"options": [
"It makes the model more interpretable",
"It prevents the cost surface from being elongated, allowing faster convergence",
"It reduces the number of features needed",
"It guarantees the model will find the global minimum"
],
"correct": 1,
"explanation": "When features have very different scales, the cost surface becomes elongated. Gradient descent takes many more steps to converge. Standardizing features makes the surface more spherical."
},
{
"id": "linreg-post-2",
"stage": "post",
"question": "The normal equation gives optimal weights directly. Why would you prefer gradient descent instead?",
"options": [
"Gradient descent always gives more accurate results",
"The normal equation does not work for linear regression",
"Matrix inversion in the normal equation is O(n^3) in features, which is too slow for thousands of features",
"Gradient descent requires less memory than storing the data"
],
"correct": 2,
"explanation": "The normal equation requires inverting X^T * X, which is O(n^3) in the number of features. For large feature counts, gradient descent is more efficient."
},
{
"id": "linreg-post-3",
"stage": "post",
"question": "A degree-10 polynomial regression model fits training data perfectly (R^2 = 1.0) but has R^2 = 0.3 on test data. What should you do?",
"options": [
"Increase the polynomial degree to 20 for even better training fit",
"Reduce model complexity (lower degree) or add regularization (Ridge) to prevent overfitting",
"Collect less training data so the model cannot memorize",
"Remove the test set and report training R^2 only"
],
"correct": 1,
"explanation": "Perfect training fit with poor test fit is overfitting. The fix is to reduce complexity (lower polynomial degree) or add regularization to penalize large weights."
}
]