MS Master of Data Science 5 — Questions and Answers
Question 1: In model deployment, what is the purpose of a feature store?
- To store trained model weights and hyperparameters
- To provide a centralized repository for computed features that can be shared across training and serving (Correct answer)
- To cache raw data from source systems before ETL
- To version control Jupyter notebooks used in experimentation
Correct answer: To provide a centralized repository for computed features that can be shared across training and serving
A feature store centralizes feature computation and storage, ensuring consistency between training and inference pipelines and enabling feature reuse across teams.
Question 2: What is the Shapley value used for in explainable AI (XAI)?
- Measuring model training speed
- Quantifying each feature's contribution to a specific prediction fairly across all feature subsets (Correct answer)
- Calculating the optimal number of layers in a neural network
- Evaluating model performance on held-out test sets
Correct answer: Quantifying each feature's contribution to a specific prediction fairly across all feature subsets
Shapley values from game theory fairly attribute prediction contributions to each feature by averaging marginal contributions across all possible feature coalitions.
Question 3: Which sampling strategy should a data scientist use when class imbalance is severe and oversampling the minority class is desired without simple duplication?
- Random undersampling
- SMOTE (Synthetic Minority Oversampling Technique) (Correct answer)
- Stratified sampling
- Cluster-based sampling
Correct answer: SMOTE (Synthetic Minority Oversampling Technique)
SMOTE generates synthetic minority class examples by interpolating between existing minority samples, creating more diverse training data than simple duplication.
Question 4: In distributed computing with Apache Spark, what is a 'shuffle' operation and why is it expensive?
- Randomly ordering rows in a DataFrame to prevent bias; expensive due to CPU usage
- Redistributing data across partitions between stages; expensive due to network I/O and disk writes (Correct answer)
- Compressing data before writing to storage; expensive due to encoding overhead
- Sorting partitions for merge joins; expensive only for large sort keys
Correct answer: Redistributing data across partitions between stages; expensive due to network I/O and disk writes
A shuffle redistributes data across all executors (e.g., during groupBy or join), requiring extensive network transfer and disk I/O, making it Spark's most costly operation.
Question 5: What is the difference between online learning and batch learning in machine learning?
- Online learning uses the internet; batch learning uses local data
- Online learning updates the model incrementally with each new observation; batch learning retrains on the full dataset periodically (Correct answer)
- Online learning is faster because it uses fewer data points; batch learning is more accurate
- Online learning requires labeled data; batch learning is unsupervised
Correct answer: Online learning updates the model incrementally with each new observation; batch learning retrains on the full dataset periodically
Online (incremental) learning updates model parameters continuously as new data arrives, while batch learning retrains the model from scratch on accumulated data.
Question 6: A data scientist computes Pearson correlation = 0.02 between two variables but a scatter plot shows a clear U-shaped pattern. What does this illustrate?
- A calculation error; Pearson correlation always detects nonlinear patterns
- Pearson correlation only captures linear relationships and can miss strong nonlinear dependencies (Correct answer)
- The scatter plot must be incorrect if the correlation is near zero
- A correlation near zero always means the variables are independent
Correct answer: Pearson correlation only captures linear relationships and can miss strong nonlinear dependencies
Pearson correlation measures only linear association; two variables with a strong nonlinear relationship can have near-zero Pearson correlation, requiring nonlinear metrics like Spearman or mutual information.
Question 7: In the bias-variance tradeoff, which scenario describes a model suffering from high bias?
- The model performs well on training data but poorly on validation data
- The model has very different performance across different random seeds
- The model underfits both training and test data due to oversimplified assumptions (Correct answer)
- The model memorizes noise in the training data
Correct answer: The model underfits both training and test data due to oversimplified assumptions
High bias means the model's assumptions are too simple, causing it to underfit by missing real patterns in both training and test data.
In model deployment, what is the purpose of a feature store?