











































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












































































Question 1. In the CRISP‑DM framework, which phase is primarily concerned with translating business objectives into a data‑mining problem? A) Data Understanding B) Business Understanding C) Modeling D) Deployment Answer: B Explanation: The Business Understanding phase defines the project goals and requirements from a business perspective and translates them into a data‑mining problem. Question 2. Which of the following is not a typical step in the Data Exploration stage? A) Detecting missing values B) Hyperparameter tuning C) Visualizing distributions D) Identifying outliers Answer: B Explanation: Hyperparameter tuning belongs to the Modeling/Optimization stage, not data exploration. Question 3. When handling missing data, which technique preserves the original variance of the feature the best? A) Deleting rows with missing values B) Mean imputation C) Median imputation D) Multiple imputation using predictive models Answer: D
Explanation: Multiple imputation models the missing values based on other variables, retaining variability, whereas simple mean/median imputation reduces variance. Question 4. Which scaling method transforms a feature to have zero mean and unit variance? A) Min‑Max Normalization B) Z‑Score Standardization C) Log‑Scaling D) Robust Scaling Answer: B Explanation: Z‑Score (standardization) subtracts the mean and divides by the standard deviation, yielding zero mean and unit variance. Question 5. One‑hot encoding a categorical variable with k distinct categories results in: A) k new binary features, each representing a category B) k‑1 binary features due to the dummy‑variable trap C) A single integer‑coded feature D) No change if the variable is already numeric Answer: A Explanation: One‑hot creates k binary columns, each indicating the presence of a specific category. Question 6. Which of the following best describes entropy in the context of decision trees? A) Measure of impurity based on class probabilities B) Average depth of the tree
B) Feature importance scores C) Cluster centroids D) Regularization parameters Answer: A Explanation: Eigenvectors define the directions of maximal variance; eigenvalues indicate the amount of variance captured. Question 10. The main difference between feature selection and feature extraction is: A) Selection chooses a subset of original features; extraction creates new features. B) Selection reduces dimensionality; extraction increases dimensionality. C) Selection is unsupervised; extraction is supervised. D) Selection uses PCA; extraction uses Lasso. Answer: A Explanation: Feature selection retains existing variables, while feature extraction transforms data into a new feature space (e.g., PCA). Question 11. In PyTorch, a tensor view is created by: A) Copying data to a new memory location B) Changing the shape without copying data C) Converting the tensor to a NumPy array D) Moving the tensor from CPU to GPU Answer: B Explanation: A view shares the same underlying data and only changes the stride/shape metadata.
Question 12. Which data type consumes the least memory while maintaining typical neural‑network precision? A) float B) float C) float D) int Answer: C Explanation: float16 (half‑precision) uses 2 bytes per element, half the memory of float32, and is often sufficient for inference/training with mixed‑precision. Question 13. A static computational graph is characteristic of: A) PyTorch eager mode B) TensorFlow 1.x (graph mode) C) JAX just‑in‑time compilation D) NumPy broadcasting Answer: B Explanation: TensorFlow 1.x builds a fixed graph before execution; dynamic graphs are built on the fly (e.g., PyTorch). Question 14. In reverse‑mode automatic differentiation, the cost of computing gradients of a scalar loss with respect to n parameters is: A) O(n) B) O(1) C) O(log n) D) O(n²) Answer: A
D) Performing a full‑batch update each iteration Answer: B Explanation: RMSProp divides the learning rate by the root of an exponentially decaying average of squared gradients, adapting step sizes. Question 18. The Adam optimizer combines which two techniques? A) Momentum and Nesterov acceleration B) RMSProp and Momentum C) AdaGrad and Newton’s method D) Stochastic Weight Averaging and Dropout Answer: B Explanation: Adam maintains both first‑moment (mean) and second‑moment (uncentered variance) estimates, effectively blending Momentum and RMSProp. Question 19. In simple linear regression, the closed‑form solution for the weight vector w is given by: A) w = (XᵀX)⁻¹Xᵀy B) w = Xᵀy C) w = (XᵀX)⁻¹y D) w = X⁻¹y Answer: A Explanation: The normal equation derives from minimizing the least‑squares error, yielding w = (XᵀX)⁻¹Xᵀy. Question 20. Which loss function is more robust to outliers in regression? A) Mean Squared Error (MSE)
B) Mean Absolute Error (MAE) C) Huber loss (δ = 1) D) Log‑cosh loss Answer: B Explanation: MAE penalizes absolute deviations linearly, reducing sensitivity to large errors compared to the squared penalty of MSE. Question 21. L1 regularization (Lasso) primarily encourages: A) Small weight magnitudes uniformly B) Sparse solutions with many zero weights C) Orthogonal weight vectors D) Faster convergence of gradient descent Answer: B Explanation: The L1 penalty adds the absolute value of weights, which tends to drive some coefficients exactly to zero, producing sparsity. Question 22. Ridge regression (L2 regularization) differs from Lasso because: A) It can set coefficients to zero B) It shrinks coefficients continuously but never to zero C) It uses a logarithmic penalty D) It only works for classification tasks Answer: B Explanation: The L2 penalty penalizes the squared magnitude, shrinking coefficients towards zero but typically not making them exactly zero. Question 23. Elastic Net regularization is useful when:
Question 26. The sigmoid function maps any real number to: A) (‑∞, ∞) B) (‑1, 1) C) (0, 1) D) (‑0.5, 0.5) Answer: C Explanation: σ(x) = 1/(1+e⁻ˣ) outputs values strictly between 0 and 1, suitable for probabilities. Question 27. For multiclass classification using logistic regression, the appropriate output activation is: A) Sigmoid applied independently to each class B) Softmax over all class logits C) ReLU on the logits D) Tanh on the logits Answer: B Explanation: Softmax normalizes logits into a probability distribution across mutually exclusive classes. Question 28. In Naïve Bayes, the assumption of conditional independence means: A) Features are independent of each other given the class label B) Classes are independent of each other C) Features are independent of the class label D) The model does not require priors Answer: A
Explanation: Naïve Bayes assumes that, conditioned on the class, each feature contributes independently to the likelihood. Question 29. Which impurity measure is equivalent to the Gini index when the number of classes is two? A) Entropy B) Misclassification error C) Two times the product of class probabilities (2p(1‑p)) D) Variance Answer: C Explanation: For binary classification, Gini = 2 p (1‑p). This expression matches the binary case of Gini impurity. Question 30. Random Forests reduce variance primarily by: A) Pruning deep trees B) Using bagging (bootstrap samples) and random feature selection at splits C) Applying L1 regularization to leaf nodes D) Gradient boosting of decision trees Answer: B Explanation: Bagging creates diverse trees, and random feature selection decorrelates them, lowering overall variance. Question 31. Gradient Boosting differs from Bagging in that it: A) Trains trees sequentially, each correcting the errors of its predecessor B) Trains all trees in parallel C) Uses only linear models as weak learners
C) Radial Basis Function (RBF) kernel D) Sigmoid kernel Answer: C Explanation: The RBF kernel represents an inner product in an infinite‑dimensional Hilbert space. Question 35. The ReLU activation function is defined as f(x)=max(0,x). A primary advantage of ReLU over sigmoid is: A) Bounded output between 0 and 1 B) Non‑zero gradient for negative inputs C) Mitigation of vanishing gradients for positive activations D) Symmetric output around zero Answer: C Explanation: For positive inputs, ReLU’s gradient is 1, preserving gradient magnitude and reducing vanishing‑gradient problems. Question 36. In backpropagation, the chain rule is applied to compute: A) The forward pass activations B) The gradient of the loss with respect to each weight C) The optimal learning rate D) The model’s inference time Answer: B Explanation: Backpropagation recursively applies the chain rule to propagate error derivatives backward through the network.
Question 37. Which pooling operation reduces spatial dimensions while preserving the strongest activation? A) Average pooling B) Max pooling C) Global average pooling D) Stochastic pooling Answer: B Explanation: Max pooling selects the maximum value within each window, retaining the most salient feature. Question 38. Dilated convolutions are useful for: A) Reducing the number of parameters while increasing receptive field B) Performing depthwise separable convolutions C) Enforcing weight sharing across channels D) Normalizing feature maps Answer: A Explanation: Dilated (atrous) convolutions insert gaps between kernel elements, expanding receptive field without extra parameters. Question 39. Residual connections in ResNet help mitigate: A) Overfitting due to excessive depth B) Vanishing gradients in very deep networks C) Data leakage between training and test sets D) Class imbalance Answer: B
B) softmax(Q · Kᵀ) · V C) softmax((Q · Kᵀ)/√dₖ) · V D) softmax(Q · Vᵀ) · K Answer: C Explanation: Scaled dot‑product attention normalizes by √dₖ to stabilize gradients. Question 43. In PyTorch, to create a custom layer you should subclass: A) torch.nn.Module B) torch.Tensor C) torch.autograd.Function D) torch.nn.Parameter Answer: A Explanation: Custom neural‑network components inherit from nn.Module and implement forward (and optionally backward) methods. Question 44. When implementing a PyTorch Dataset, which method must be defined to return a single data point? A) len B) getitem C) iter D) call Answer: B Explanation: getitem(self, idx) retrieves the sample at index idx; len provides the dataset size. Question 45. In a DataLoader, setting shuffle=True is most important for:
A) Ensuring reproducibility B) Reducing memory consumption C) Preventing model from learning the order of training data D) Enabling distributed training automatically Answer: C Explanation: Shuffling randomizes the presentation order, reducing the risk of the model overfitting to data order. Question 46. The k‑means algorithm minimizes which objective function? A) Sum of squared distances between points and their assigned cluster centroids B) Sum of absolute distances between points and centroids C) Negative log‑likelihood of a Gaussian mixture D) Silhouette coefficient Answer: A Explanation: k‑means seeks to minimize the within‑cluster sum of squared Euclidean distances. Question 47. In Gaussian Mixture Models, the E‑step of the EM algorithm computes: A) Updated means and covariances B) Posterior probabilities (responsibilities) of each component for each data point C) The log‑likelihood of the model D) The gradient of the loss function Answer: B Explanation: The Expectation step estimates the probability that each data point belongs to each Gaussian component.
Explanation: 5‑fold CV partitions data into five subsets; each fold serves once as the test set while the remaining four form the training set. Question 51. Leave‑one‑out cross‑validation (LOOCV) is most computationally expensive because: A) It requires training the model n times, where n is the number of samples B) It uses a very large validation set C) It cannot be parallelized D) It needs a separate hyperparameter search for each fold Answer: A Explanation: LOOCV trains the model once per data point, leading to n training runs. Question 52. Data parallelism across multiple GPUs works by: A) Replicating the model on each GPU and feeding each a different mini‑batch B) Splitting the model layers across GPUs (model parallelism) C) Sharing a single GPU memory buffer among all GPUs D) Running inference only, not training Answer: A Explanation: Each GPU processes a distinct mini‑batch; gradients are aggregated to update the shared model. Question 53. Model parallelism is advantageous when: A) The model is too large to fit into a single GPU’s memory B) Training data is extremely small C) The optimizer is Adam D) Using a CPU‑only environment
Answer: A Explanation: Model parallelism distributes different layers or parts of a network across devices, allowing training of very large models. Question 54. Writing a custom PyTorch autograd Function requires implementing which two static methods? A) forward and backward B) init and call C) len and getitem D) setup and teardown Answer: A Explanation: Custom autograd Functions define static forward (computes output) and backward (computes gradients) methods. Question 55. A C++/CUDA extension for PyTorch is primarily used to: A) Reduce the number of Python dependencies B) Accelerate computationally intensive kernels beyond what PyTorch’s built‑in ops provide C) Convert tensors to NumPy arrays automatically D) Enable model export to ONNX format Answer: B Explanation: CUDA extensions allow developers to write custom GPU kernels for performance‑critical operations. Question 56. Which of the following is not a typical preprocessing step for image data before feeding it to a CNN? A) Resizing to a fixed resolution