← COMP5541 全部讲次
Q05

Final 选择题|B 第 1–3 讲

期末复习用的 18 道非官方自拟英文单选题,覆盖 KNN、参数化模型、线性回归、梯度下降、偏差方差、逻辑回归、softmax 与朴素贝叶斯,每个选项附对错理由与课件页码。

手机上宽表格可左右滑动;自测答案默认收起,点击题目下方按钮查看。

使用边界:期末复习,非官方材料。课程信息写期末闭卷、3 小时、选择题加数学计算题;日期、地点与范围尚未公布,以讲师通知和课堂公告为准。本页是按第 1–3 讲课件自拟的单选题。

复习资料:考试形式与范围地图 · 闭卷公式默写表 · 算法横向对照

先做题再看解析:A 计算:第 1–3 讲 · B 选择:第 1–3 讲 · C 计算:第 4–7 讲 · D 选择:第 4–7 讲 · E 计算:第 8–10 讲 · F 选择:第 8–10 讲

怎么做:每题先排除再选,四个选项都要能说出对错的理由,再展开对照。

B 选择题:第 1–3 讲

B1–B5 考第 1 讲,B6–B11 考第 2 讲,B12–B17 考第 3 讲,B18 考 Practical 1 的统计工具。每题四个选项、单选。

B1 · Parametric or not

According to L01, which of the following is a parametric model?

  • A. KNN with K fixed at 5
  • B. Gaussian Processes
  • C. Linear regression
  • D. Any model whose number of parameters grows with the size of the training set
B1 · 查看答案与解析

答案:C。A 错:K 固定也只是超参数,KNN 要存全部训练点,课件列为 non-parametric。B 错:Gaussian Processes 和 KNN 同列 non-parametric。C 对:参数个数 D + 1,与样本数 N 无关。D 错:参数随数据量增长是 non-parametric 的特征。

English: C. Linear regression has a finite set of parameters (D + 1, independent of N). KNN and Gaussian Processes are non-parametric; fixing K does not change that, because K is a hyperparameter and KNN still keeps all training points.

回查:L01 p.43(L01a);L02 p.7 参数个数(L02a)。

B2 · The ML map

Which statement matches the paradigm–task–algorithm map in L01?

  • A. Every algorithm belongs to exactly one learning paradigm.
  • B. Paradigms are separated by the size of the model.
  • C. Regression is listed as an unsupervised task.
  • D. The same algorithm family, such as DNNs, can appear under more than one paradigm.
B2 · 查看答案与解析

答案:D。A 错:DNN 同时出现在监督与无监督两行。B 错:范式按监督信号的形式划分,和模型大小无关。C 错:回归和分类同属监督学习任务。

English: D. On the map, DNNs appear under both supervised and unsupervised learning; paradigms are distinguished by the form of the supervision signal, not by the model.

回查:L01 p.42(L01a)。

B3 · Cost of KNN

Which statement about the computational cost of KNN is correct?

  • A. Training is expensive because KNN runs gradient descent over the training set.
  • B. Training is almost free, but each prediction compares the query with all N training points.
  • C. Prediction is fast because only K distances are computed.
  • D. KNN stores only the K nearest points after training.
B3 · 查看答案与解析

答案:B。A 错:KNN 没有梯度下降,训练只是存数据。C 错:要先算全部 N 个距离再排序,才知道哪 K 个最近。D 错:最近的 K 个随查询点变,必须存全部训练数据,「存储大」这条局限就来自这里。

English: B. KNN has no training phase beyond storing the data, so prediction is slow: every query needs the distance to all N training points (O(N)) before sorting and picking the top K.

回查:L01 p.49 四步(L01b);p.52 局限(L01c)。

B4 · Last step of KNN regression

In KNN regression, what does step 4 do once the K nearest neighbours are found?

  • A. Output the mean (or a weighted mean) of the neighbours’ target values.
  • B. Output the most frequent target value among the neighbours.
  • C. Output the target value of the farthest of the K neighbours.
  • D. Output the median of all training targets.
B4 · 查看答案与解析

答案:A。B 错:多数投票是分类的第 4 步,连续值很少重复,投票没有意义。C 错:最远的邻居最不相似,没有理由单取它。D 错:用全部训练数据就丢了「近邻相似」这一假设。

English: A. For regression the labels are continuous, so the final prediction is the mean or weighted mean of the K neighbours’ targets; majority voting is the classification rule.

回查:L01 p.50–51(L01c)。

B5 · What KNN does not suffer from

Which of the following is NOT one of the limitations of KNN listed in L01?

  • A. Slow prediction
  • B. Large storage
  • C. Sensitivity to the scale of features, so normalization is needed
  • D. Needing many iterations of gradient descent to train
B5 · 查看答案与解析

答案:D。A、B、C 都是课件四问里列出的局限(另一条是维度灾难);KNN 不迭代训练,D 不是它的局限。

English: D. The listed limitations are slow prediction, large storage, sensitivity to feature scale (normalize first) and the curse of dimensionality. KNN has no iterative training at all.

回查:L01 p.52(L01c)。

B6 · Least squares, MSE and MAE

For a 1-D linear regression on the same data, which statement is correct?

  • A. Least squares, MSE and MAE always give the same w and b.
  • B. Least squares and MSE give the same w and b; MAE may give a different line.
  • C. MSE divides by N, so its minimizer differs from the least-squares solution.
  • D. MAE has the same closed-form solution as least squares.
B6 · 查看答案与解析

答案:B。A 错:MAE 惩罚误差的方式不同,最优直线可能不同。C 错:乘常数 1/N 不改变最小点位置。D 错:课件的闭式解只对应平方误差。

English: B. MSE equals the sum of squared errors times the constant 1/N, so both have the same minimizer. MAE penalizes errors differently and can lead to a different fitted line.

回查:L02 p.17–18(L02a)。

B7 · Step size in gradient descent

Gradient descent with a fixed learning rate η is run on the MSE of a linear regression. Which statement is correct?

  • A. Every update moves w by the same distance η.
  • B. The update to w is always negative.
  • C. The steps get smaller as the gradient gets smaller near the minimum.
  • D. With a fixed η the loss always reaches the minimum in one step.
B7 · 查看答案与解析

答案:C。A 错:步长是 η 乘梯度,梯度变,步长就变。B 错:方向取决于梯度符号,梯度为负时 w 增大。D 错:一般要多步迭代,课件还要求设最大迭代次数。

English: C. The update is w ← w − η dL/dw, so its size is proportional to the gradient: steps are large far from the minimum and shrink near it. The sign depends on the gradient, and a maximum number of iterations is set as a stopping rule.

回查:L02 p.21(L02a-2)。

B8 · Polynomial basis

The model y = w₁x + w₂x² + w₃x³ + b is fitted with MSE. Which statement is correct?

  • A. It is still linear in the parameters, so the same least-squares / gradient-descent machinery applies after expanding x into (x, x², x³).
  • B. It is non-linear in the parameters, so least squares cannot be used.
  • C. It needs the cross-entropy loss instead of MSE.
  • D. Adding the x² and x³ terms always lowers the test error.
B8 · 查看答案与解析

答案:A。B 错:把 x² 当新特征,模型对参数仍是线性的。C 错:仍是回归问题,用 MSE。D 错:加高次项只保证训练误差不升,测试误差可能因过拟合上升。

English: A. Polynomial basis expansion only changes the features; the model remains linear in w, so it is solved exactly like linear regression. Higher degree never increases the training error, but it can increase the test error.

回查:L02 p.27–30(L02b)。

B9 · Error curves

As model complexity (polynomial degree) increases on a fixed training set, which description matches L02?

  • A. Both training and test error decrease monotonically.
  • B. Training error is U-shaped; test error decreases monotonically.
  • C. Test error increases monotonically from the start.
  • D. Training error keeps decreasing; test error first decreases then increases.
B9 · 查看答案与解析

答案:D。A 错:复杂度过高时测试误差回升。B 错:两条曲线的形状说反了。C 错:低复杂度时测试误差也在下降(欠拟合区)。

English: D. Training error decreases monotonically with complexity, while test error is U-shaped: the left side is underfitting and the right side is overfitting.

回查:L02 p.30(L02b);p.34(L02b-2)。

B10 · Diagnosis: fits training, fails test

A model has very low training error but large error on the testing data. Which diagnosis and remedy match L02?

  • A. Large bias; add more training data.
  • B. Large variance; use regularization or collect more data.
  • C. Large bias; increase the polynomial degree.
  • D. Large variance; add more polynomial features.
B10 · 查看答案与解析

答案:B。A 错:能拟合训练集就不是大偏差,而且课件说加数据对大偏差无效。C 错:诊断错,加复杂度会让方差更大。D 错:诊断对,药开反了,加特征加剧过拟合。

English: B. If the model can fit the training data but has large test error, the problem is probably large variance. The remedies are regularization, more data, or redesigning (simplifying) the model.

回查:L02 p.34、p.36(L02b-2)。

B11 · Remedy for large bias

A model cannot even fit the training data well. Which action is suggested in L02?

  • A. Collect more training data.
  • B. Add stronger regularization.
  • C. Use polynomial basis expansion or a more complicated model.
  • D. Remove some input features.
B11 · 查看答案与解析

答案:C。A 错:课件明说大偏差时加数据没用。B 错:正则化让模型更受约束,偏差更大。D 错:减特征同样让模型更简单。

English: C. Large bias means the model is too simple, so we should make it more expressive, for example by polynomial basis expansion or a more complicated model. More data does not help a model that cannot fit the training set.

回查:L02 p.35(L02b-2)。

B12 · Discriminative vs generative

Which statement correctly contrasts logistic regression (LR) and the Naive Bayes classifier (NBC)?

  • A. LR models P(y | x) directly with one set of parameters; NBC models P(y) and P(x | y) and applies Bayes’ rule at test time.
  • B. Both LR and NBC model P(x | y).
  • C. NBC is discriminative and LR is generative.
  • D. LR applies Bayes’ rule at test time to obtain P(y | x).
B12 · 查看答案与解析

答案:A。B 错:LR 不建模 P(x | y)。C 错:两者的类别说反了。D 错:用贝叶斯法则的是生成式的 NBC。

English: A. LR is discriminative: it learns P(y | x) directly with one set of parameters. NBC is generative: it learns P(y) and P(x | y) (two sets of parameters) and combines them with Bayes’ rule at test time.

回查:L03 p.9(L03b)。

B13 · Which family

Which of the following is listed in L03 as a generative model?

  • A. SVM
  • B. CRF
  • C. Logistic regression
  • D. HMM
B13 · 查看答案与解析

答案:D。A、B、C 错:课件把 LR、SVM、CRF 列在判别式一侧;生成式一侧是 NBC、MRF、HMM。

English: D. The discriminative family listed is LR, SVM and CRF; the generative family is NBC, MRF and HMM.

回查:L03 p.10(L03b)。

B14 · Why not L2 loss for logistic regression

Why does L03 prefer cross entropy over the L2 loss for logistic regression?

  • A. The L2 loss cannot be differentiated through the sigmoid.
  • B. Cross entropy has a closed-form minimizer like least squares.
  • C. With the L2 loss the gradient contains the factor y(1 − y), so it approaches 0 when y is near 0 or 1 even if the prediction is wrong, and the loss surface is flat.
  • D. The L2 loss makes linear regression non-convex as well.
B14 · 查看答案与解析

答案:C。A 错:L2 能求导,只是梯度 2(y − ȳ)y(1 − y)x 在两端趋于 0。B 错:交叉熵没有闭式解,要用梯度下降。D 错:线性回归配 MSE 是凸的。

English: C. With the L2 loss, dL/dw = 2(y − ȳ)y(1 − y)x, which vanishes as y approaches 0 or 1, even when the prediction is badly wrong; the L2 loss surface is flat. With cross entropy the factor y(1 − y) cancels and the gradient is (y − ȳ)x.

回查:L03 p.18–19(L03a-3);L02 p.23 凸性(L02a-2)。

B15 · Where cross entropy comes from

Which statement about cross entropy in L03 is correct?

  • A. Cross entropy is the mean squared error written in a different form.
  • B. Minimizing the cross-entropy loss is equivalent to maximizing the likelihood of the training labels.
  • C. Minimizing cross entropy has a closed-form solution, so gradient descent is unnecessary.
  • D. Maximum likelihood estimation needs no optimization at all.
B15 · 查看答案与解析

答案:B。A 错:两种损失形式不同,梯度也不同(见 B14)。C 错:推出交叉熵之后仍用梯度下降求解。D 错:最大似然本身就是优化问题。

English: B. Maximum likelihood estimation of the labels is equivalent to minimizing the cross-entropy loss; the minimization is then done by gradient descent.

回查:L03 p.21(L03a-3)。

B16 · Softmax

Which statement about the softmax classifier in L03 is correct?

  • A. With two classes softmax reduces to the sigmoid, and the boundaries between classes are linear in x.
  • B. Because of the exponential, the decision boundaries of softmax regression are non-linear in x.
  • C. The multi-class cross entropy adds −ln(1 − y_c) over all wrong classes.
  • D. The softmax outputs do not need to sum to 1.
B16 · 查看答案与解析

答案:A。B 错:指数单调,不改变哪个分数最大,两类之间的边界是两个线性分数相等的地方。C 错:one-hot 标签下多类交叉熵 −Σȳᵢ ln yᵢ 只剩 −ln y_correct。D 错:每个指数除以全部指数之和,概率和为 1。

English: A. Sigmoid is the two-class special case of softmax. Since exp is monotonic, the boundary between two classes is where their linear scores are equal, which is linear in x. The multi-class cross entropy reduces to −ln of the correct class’s probability.

回查:L03 p.23(L03a-4)。

B17 · Strengths of NBC vs LR

Which pair lists advantages of the Naive Bayes classifier given in L03?

  • A. Better predictive accuracy and well-calibrated probabilities
  • B. Can handle feature preprocessing and needs gradient descent
  • C. Easy to fit (no iteration) and can handle missing features
  • D. Requires every feature to be observed and fits all classes jointly
B17 · 查看答案与解析

答案:C。A 错:这两条是课件给 LR 的优点。B 错:前半句也是 LR 的优点,NBC 只需计数和估计均值方差,不需要梯度下降。D 错:NBC 能处理缺失特征,而且各类分开拟合。

English: C. NBC is easy to fit because it only counts and estimates per-class statistics without iteration, and it can handle missing features. Better predictive accuracy, handling feature preprocessing and well-calibrated probabilities are listed as advantages of LR.

回查:L03 p.30–31(L03b-2)。

B18 · Bias of the sample variance

Which statement matches Practical 1 on estimators?

  • A. The sample mean is biased, while the variance divided by n is unbiased.
  • B. Both the sample mean and the variance divided by n are unbiased.
  • C. Standardization subtracts the median and divides by the range.
  • D. The sample mean is unbiased; the variance divided by n is biased (too small on average), and dividing by n − 1 removes this bias.
B18 · 查看答案与解析

答案:D。A 错:两个结论都说反了。B 错:除以 n 的方差系统性偏小,期望是 ((n − 1)/n)σ²。C 错:标准化是 (x − x̄)/σ,减均值、除以标准差。

English: D. E[x̄] = μ, so the sample mean is unbiased. The variance divided by n has expectation ((n − 1)/n)σ², which is too small on average; dividing by n − 1 gives an unbiased estimator. Standardization uses (x − x̄)/σ.

回查:Practical 1 统计三问(P01b)。

下一页 →
Q06 Final 计算题|C 第 4–7 讲

个人整理的学习笔记,不是官方材料;数字与结论以课件和讲师为准。