Which of the following best describes the bias-variance tradeoff in machine learning?
Answer: B
Bias refers to the error due to overly simplistic assumptions in the learning algorithm. A high-bias model underfits the data. Variance refers to the sensitivity of the model to fluctuations in training data. A high-variance model overfits the data by learning noise. The tradeoff involves finding a balance to minimize total error.
Q.2Medium
In logistic regression, what is the range of the sigmoid activation function σ(z)=1+e−z1?
Answer: B
The sigmoid function σ(z)=1+e−z1 maps any real-valued input to the range (0,1). At the boundaries, σ(z)→0 as z→−∞ and σ(z)→1 as z→+∞. It never actually reaches 0 or 1, so the strict range is (0,1), which is best described by the closed interval [0,1] among the given options.
Q.3Medium
Which regularization technique adds the absolute values of the coefficients as a penalty term to the loss function?
Answer: C
Lasso (Least Absolute Shrinkage and Selection Operator) regression uses L1 regularization, adding a penalty term λ∑j∣wj∣ to the loss function. This can shrink some coefficients exactly to zero, effectively performing feature selection. Ridge regression uses L2 regularization with a penalty of λ∑jwj2.
Q.4Medium
In a decision tree, which criterion measures the impurity of a node using the formula H=−∑i=1cpilog2(pi)?
Answer: C
The formula H=−∑i=1cpilog2(pi) defines Shannon Entropy, which measures the impurity or disorder at a node. Information Gain is computed as the reduction in entropy after a split. Gini Impurity uses a different formula: G=1−∑i=1cpi2. Entropy is the correct answer here.
Q.5Medium
Which of the following is a key difference between bagging and boosting ensemble methods?
Answer: C
Bagging (Bootstrap Aggregating) trains multiple models in parallel, each on a different random bootstrap sample of the training data, and combines predictions by averaging or voting. Boosting trains models sequentially, where each new model focuses on correcting the errors made by previous models by adjusting sample weights. Random Forest is a popular bagging method; AdaBoost and Gradient Boosting are boosting methods.
Q.6Medium
For a binary classification problem, the F1-score is defined as the harmonic mean of precision and recall. Which formula correctly represents it?
Answer: B
The F1-score is the harmonic mean of Precision and Recall:
F1=Precision+Recall2×Precision×Recall
It is preferred over simple average when there is class imbalance, as it penalizes extreme differences between precision and recall. Option A is the arithmetic mean, not the harmonic mean.
Q.7Medium
In k-means clustering, what is the objective function that the algorithm seeks to minimize?
Answer: B
The k-means algorithm minimizes the Within-Cluster Sum of Squares (WCSS), also called inertia:
J=k=1∑Kxi∈Ck∑∥xi−μk∥2
where μk is the centroid of cluster Ck. The algorithm iteratively assigns points to the nearest centroid and recomputes centroids to minimize this objective.
Q.8Medium
Which of the following statements about Support Vector Machines (SVMs) is correct?
Answer: B
The kernel trick is a key feature of SVMs. It allows the algorithm to compute dot products in a high-dimensional (or even infinite-dimensional) feature space implicitly using a kernel function K(xi,xj)=ϕ(xi)⋅ϕ(xj), without explicitly computing ϕ. This enables SVMs to handle non-linear data. SVMs maximize the margin (distance between classes), not within-class variance. Support vectors are the points closest to the decision boundary, not the farthest.
Q.9Medium
Which cross-validation technique is most appropriate when the dataset is small and every data point needs to be used for both training and testing?
Answer: C
Leave-One-Out Cross-Validation (LOOCV) is ideal for small datasets. In LOOCV, each data point is used once as a test set while all remaining n−1 points form the training set. This is repeated n times. It makes maximum use of available data and provides an almost unbiased estimate of model performance, though it can be computationally expensive for large datasets.
Q.10Medium
In gradient descent, what happens if the learning rate α is set too large?
Answer: B
In gradient descent, the parameter update rule is w:=w−α∇wJ(w). If the learning rate α is too large, the step size overshoots the minimum. This causes the loss function to oscillate around or diverge away from the minimum rather than converging. A too-small learning rate causes very slow convergence. An optimal learning rate balances convergence speed and stability.