Docsity

Certified Machine Learning Python Certification Exam Preparation, Exams of Technology

Toggle sidebar
bg1
Certified Machine Learning Python Certification
Exam Preparation
**Question 1.** Which Pandas function is most appropriate for reading a JSON file that
contains nested records?
A) `pd.read_csv()`
B) `pd.read_json()`
C) `pd.read_excel()`
D) `pd.read_sql()`
Answer: B
Explanation: `pd.read_json()` can parse JSON strings and files, handling nested structures when
combined with `json_normalize`.
**Question 2.** When using mean imputation for missing numerical values, which of the
following is a potential drawback?
A) It preserves the original variance of the feature.
B) It can introduce bias if data are not missing completely at random.
C) It reduces the dimensionality of the dataset.
D) It always improves model performance.
Answer: B
Explanation: Mean imputation assumes missingness is random; otherwise, it can bias the
feature distribution.
**Question 3.** Which statistical test is appropriate for assessing the monotonic relationship
between two ordinal variables?
A) Pearson correlation
B) Spearman rank correlation
C) Chi‑square test
D) ANOVA
Answer: B
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b

Partial preview of the text

Download Certified Machine Learning Python Certification Exam Preparation and more Exams Technology in PDF only on Docsity!

Exam Preparation

Question 1. Which Pandas function is most appropriate for reading a JSON file that contains nested records? A) pd.read_csv() B) pd.read_json() C) pd.read_excel() D) pd.read_sql() Answer: B Explanation: pd.read_json() can parse JSON strings and files, handling nested structures when combined with json_normalize. Question 2. When using mean imputation for missing numerical values, which of the following is a potential drawback? A) It preserves the original variance of the feature. B) It can introduce bias if data are not missing completely at random. C) It reduces the dimensionality of the dataset. D) It always improves model performance. Answer: B Explanation: Mean imputation assumes missingness is random; otherwise, it can bias the feature distribution. Question 3. Which statistical test is appropriate for assessing the monotonic relationship between two ordinal variables? A) Pearson correlation B) Spearman rank correlation C) Chi‑square test D) ANOVA Answer: B

Exam Preparation

Explanation: Spearman correlation measures monotonic (not necessarily linear) relationships using rank values. Question 4. In the context of outlier detection, the Interquartile Range (IQR) method classifies a data point as an outlier if it lies beyond: A) 1.5 × IQR below Q1 or above Q B) 2 × IQR below Q1 or above Q C) 3 × standard deviation from the mean D) The 5th or 95th percentile Answer: A Explanation: The conventional IQR rule flags points outside Q1 − 1.5·IQR or Q3 + 1.5·IQR. Question 5. Which encoding technique can cause the “dummy variable trap” if not handled properly? A) Label Encoding B) One‑Hot Encoding C) Target Encoding D) Frequency Encoding Answer: B Explanation: One‑Hot Encoding creates linearly dependent columns; dropping one column avoids multicollinearity. Question 6. For a feature with a highly skewed distribution, which scaling method is generally more appropriate? A) Min‑Max Scaling B) Standardization (Z‑score) C) Log transformation followed by Standardization

Exam Preparation

B) Lasso (L1) C) Elastic Net D) None of the above Answer: B Explanation: L1 penalty encourages sparsity, driving less important coefficients to zero. Question 10. The coefficient of determination (R²) can be negative when: A) The model perfectly fits the data B) The model predicts the mean of the target for all instances C) The model performs worse than a simple mean predictor D) The model has more than one predictor Answer: C Explanation: R² = 1 − (SS_res / SS_tot); if SS_res > SS_tot, R² becomes negative, indicating a poor model. Question 11. In logistic regression, the loss function minimized during training is: A) Mean Squared Error B) Hinge loss C) Cross‑entropy (log loss) D) Absolute error Answer: C Explanation: Logistic regression uses binary cross‑entropy to penalize incorrect probability estimates. Question 12. Which kernel function allows a Support Vector Machine to create non‑linear decision boundaries by mapping data into an infinite‑dimensional space?

Exam Preparation

A) Linear kernel B) Polynomial kernel C) Radial Basis Function (RBF) kernel D) Sigmoid kernel Answer: C Explanation: The RBF kernel computes similarity based on distance, implicitly mapping inputs to an infinite‑dimensional feature space. Question 13. In K‑Nearest Neighbors, which distance metric is most appropriate for high‑dimensional sparse text data represented as TF‑IDF vectors? A) Euclidean distance B) Manhattan distance C) Cosine similarity (converted to distance) D) Chebyshev distance Answer: C Explanation: Cosine similarity measures the angle between vectors, ignoring magnitude, which works well for sparse high‑dimensional data. Question 14. The Naïve Bayes classifier assumes conditional independence between features. Which variant is best suited for modeling word counts in document classification? A) Gaussian Naïve Bayes B) Multinomial Naïve Bayes C) Bernoulli Naïve Bayes D) Categorical Naïve Bayes Answer: B Explanation: Multinomial Naïve Bayes models discrete counts, making it ideal for bag‑of‑words representations.

Exam Preparation

Question 18. In the Elbow method for K‑Means clustering, the “elbow” point corresponds to: A) The number of clusters where within‑cluster sum of squares (WCSS) starts to increase B) The number of clusters after which additional clusters provide diminishing reduction in WCSS C) The maximum possible number of clusters D) The point where silhouette score is highest Answer: B Explanation: The elbow indicates where adding more clusters yields little gain in compactness. Question 19. Which linkage criterion in hierarchical clustering tends to produce compact, spherical clusters? A) Single linkage B) Complete linkage C) Average linkage D) Ward’s method Answer: D Explanation: Ward’s method minimizes the increase in total within‑cluster variance, favoring compact clusters. Question 20. DBSCAN defines a core point as a point that has at least minPts neighbors within a radius ε. Which situation leads DBSCAN to label many points as noise? A) Very large ε B) Very small ε C) High minPts with large ε D) Low minPts with small ε

Exam Preparation

Answer: B Explanation: A tiny ε results in few points meeting the density requirement, causing many points to be classified as noise. Question 21. In the Apriori algorithm, the support of an itemset is defined as: A) The proportion of transactions containing the itemset B) The confidence of the rule derived from the itemset C) The lift of the itemset relative to the whole dataset D) The number of distinct items in the itemset Answer: A Explanation: Support = (transactions containing itemset) / (total transactions). Question 22. Which activation function suffers from the “dying ReLU” problem, where neurons stop updating? A) Sigmoid B) Tanh C) ReLU D) Softmax Answer: C Explanation: If a ReLU neuron receives negative inputs consistently, its gradient becomes zero, preventing further learning. Question 23. The gradient of the loss with respect to weights in a deep neural network can explode when: A) Using a very small learning rate B) Initializing weights with large variance

Exam Preparation

A) Reduce model size B) Accelerate training by stabilizing layer input distributions C) Increase model interpretability D) Perform feature selection Answer: B Explanation: Normalizing mini‑batch activations mitigates internal covariate shift, enabling higher learning rates. Question 27. In a Convolutional Neural Network, the operation that reduces spatial dimensions while retaining the most salient features is called: A) Convolution B) Pooling (e.g., max‑pool) C) Fully connected layer D) Dropout Answer: B Explanation: Pooling aggregates nearby activations, typically halving height/width and preserving dominant signals. Question 28. Which recurrent architecture explicitly addresses the vanishing gradient problem by using gated mechanisms? A) Simple RNN B) LSTM (Long Short‑Term Memory) C) Feed‑forward network D) Autoencoder Answer: B Explanation: LSTM cells contain input, forget, and output gates that regulate gradient flow.

Exam Preparation

Question 29. Stratified K‑Fold cross‑validation is particularly important when: A) The dataset is extremely large B) The target variable is highly imbalanced C) Features are all numeric D) Using unsupervised learning algorithms Answer: B Explanation: Stratification preserves class proportions in each fold, ensuring reliable performance estimates for imbalanced data. Question 30. The bias‑variance trade‑off describes the relationship between model complexity and: A) Training time only B) Model interpretability only C) Expected prediction error, decomposed into bias and variance components D) Number of features Answer: C Explanation: As complexity increases, bias decreases while variance increases; optimal models balance both. Question 31. Which metric is most appropriate for evaluating a binary classifier on a dataset with 1 % positive class prevalence? A) Accuracy B) Precision C) Recall D) F1‑Score

Exam Preparation

C) ONNX (.onnx) D) All of the above Answer: D Explanation: All three can serialize the entire pipeline; ONNX is framework‑agnostic, while Pickle/Joblib are Python‑specific. Question 35. Data drift detection typically compares: A) Model training time vs. inference time B) Distribution of input features in production vs. training data C) Number of parameters in the model D) GPU vs. CPU usage Answer: B Explanation: Data drift occurs when feature distributions shift, potentially degrading model performance. Question 36. Under GDPR, which principle requires that personal data used in ML be minimized and only what is necessary for the purpose? A) Right to be forgotten B) Data minimization C) Purpose limitation D) Data portability Answer: B Explanation: Data minimization mandates collecting and processing only essential personal data. Question 37. An adversarial example is created by:

Exam Preparation

A) Adding random noise to the input data B) Slightly perturbing inputs in a direction that maximally increases model loss C) Removing outliers from the training set D) Scaling features to a different range Answer: B Explanation: Targeted perturbations exploit model vulnerabilities, causing misclassification while remaining imperceptible. Question 38. Which technique can mitigate algorithmic bias caused by imbalanced training data? A) Oversampling the minority class (e.g., SMOTE) B) Reducing the number of features C) Using a deeper neural network D) Increasing the learning rate Answer: A Explanation: Oversampling balances class representation, reducing bias toward the majority class. Question 39. In time‑series forecasting with an LSTM, which preprocessing step is essential to preserve temporal order? A) Random shuffling of rows B) Stratified sampling C) Sliding window creation D) One‑Hot Encoding of timestamps Answer: C Explanation: Sliding windows generate sequences preserving chronological dependencies for LSTM input.

Exam Preparation

Answer: C Explanation: Bagging (Bootstrap Aggregating) creates diverse models via resampling and averages them to lower variance. Question 43. In XGBoost, the term “tree depth” primarily affects: A) Model bias B) Model variance C) Learning rate D) Number of estimators Answer: B Explanation: Deeper trees can capture more complex patterns, increasing variance and risk of overfitting. Question 44. Which method can be used to detect multicollinearity among numeric features before modeling? A) Plotting a histogram of each feature B) Calculating the Variance Inflation Factor (VIF) C) Performing a t‑test on each feature D) Using K‑Fold cross‑validation Answer: B Explanation: VIF quantifies how much variance of a regression coefficient is inflated due to collinearity. Question 45. A model’s precision is high but recall is low. Which business scenario might still consider this model acceptable? A) Spam detection where false positives are costly B) Medical diagnosis where missing a disease is unacceptable

Exam Preparation

C) Credit card fraud detection where catching many frauds is critical D) Recommender system where diversity is prioritized Answer: A Explanation: In spam detection, marking legitimate email as spam (false positive) is undesirable; high precision ensures flagged emails are truly spam. Question 46. Which of the following is a valid reason to prefer Label Encoding over One‑Hot Encoding for a tree‑based model? A) Trees can handle ordinal relationships implicitly, and one‑hot can increase dimensionality unnecessarily. B) Label Encoding reduces overfitting in linear models. C) One‑Hot Encoding is required for all models. D) Label Encoding prevents the dummy variable trap. Answer: A Explanation: Tree algorithms split on feature values directly; label‑encoded categories do not mislead the model and keep feature space compact. Question 47. In a confusion matrix for a binary classifier, which cell corresponds to False Negatives? A) Top‑left (True Positive) B) Top‑right (False Positive) C) Bottom‑left (False Negative) D) Bottom‑right (True Negative) Answer: C Explanation: The bottom‑left cell counts actual positives predicted as negative. Question 48. The softmax activation function is appropriate for:

Exam Preparation

Question 51. Which technique can reduce the risk of overfitting in a Random Forest model without changing the number of trees? A) Increase max_features to the total number of features B) Decrease max_depth of each tree C) Remove bootstrap sampling D) Increase min_samples_split to a very large number Answer: B Explanation: Limiting tree depth reduces model complexity, lowering overfitting while keeping the ensemble size constant. Question 52. In the context of feature importance, permutation importance differs from built‑in importance because it: A) Requires retraining the model from scratch. B) Measures the decrease in model performance after randomly shuffling a feature. C) Is only applicable to linear models. D) Always yields higher importance scores. Answer: B Explanation: Permutation importance evaluates the impact on predictions when a feature’s values are permuted, reflecting its true contribution. Question 53. Which loss function is most suitable for training a regression model that is robust to outliers? A) Mean Squared Error (MSE) B) Mean Absolute Error (MAE) C) Huber loss D) Log‑cosh loss

Exam Preparation

Answer: C Explanation: Huber loss behaves like MSE near zero error and like MAE for large errors, offering robustness. Question 54. In a binary classification problem, the ROC curve plots: A) Precision vs. Recall B) True Positive Rate vs. False Positive Rate C) Accuracy vs. Threshold D) Loss vs. Epochs Answer: B Explanation: The ROC curve visualizes the trade‑off between sensitivity (TPR) and 1‑specificity (FPR) across thresholds. Question 55. Which of the following is a model‑agnostic method for detecting feature interactions? A) Partial Dependence Plots (PDP) B) Decision tree depth analysis C) Weight magnitude in neural networks D) Correlation matrix Answer: A Explanation: PDPs can illustrate how the prediction changes with two features jointly, revealing interactions. Question 56. When using SMOTE to address class imbalance, the synthetic samples are generated by: A) Randomly duplicating minority class instances. B) Interpolating between a minority instance and its nearest minority neighbors.