MS-DS Master of Data science Master of Data Science 5 — Questions and Answers
Question 1: What is the purpose of the 'EXPLAIN' command in SQL?
- To display the schema of a table
- To show the query execution plan chosen by the optimizer (Correct answer)
- To list all indexes on a table
- To describe the data types of each column
Correct answer: To show the query execution plan chosen by the optimizer
EXPLAIN reveals the execution plan the database engine will use to run a query, helping identify bottlenecks like full table scans.
Question 2: Which ensemble method trains multiple models sequentially, where each new model corrects the errors of the previous one?
- Bagging
- Gradient boosting (Correct answer)
- Random forest
- Voting classifier
Correct answer: Gradient boosting
Gradient boosting builds models sequentially, with each tree fitting the residual errors (negative gradient of the loss) of the ensemble so far.
Question 3: In NLP, what does TF-IDF measure?
- The frequency of a term in all documents in a corpus
- The importance of a term in a document relative to how common it is across all documents (Correct answer)
- The semantic similarity between two terms
- The probability that a word appears at a given position
Correct answer: The importance of a term in a document relative to how common it is across all documents
TF-IDF weights terms by their frequency in a document (TF) multiplied by the inverse of how many documents contain them (IDF), boosting rare but relevant terms.
Question 4: What is a key advantage of using a data lake over a traditional data warehouse?
- Stronger ACID transaction guarantees
- Ability to store raw, unstructured, and semi-structured data at low cost without requiring a predefined schema (Correct answer)
- Faster query performance for structured analytics
- Better support for row-level security
Correct answer: Ability to store raw, unstructured, and semi-structured data at low cost without requiring a predefined schema
Data lakes store data in its native format on cheap object storage, deferring schema definition to query time (schema-on-read), enabling flexible use of diverse data types.
Question 5: Which Python library provides the DataFrame abstraction and is the standard tool for tabular data manipulation in data science?
- NumPy
- pandas (Correct answer)
- scikit-learn
- SciPy
Correct answer: pandas
pandas provides the DataFrame and Series objects with powerful data manipulation, aggregation, and I/O capabilities for tabular data.
Question 6: In causal inference, what is the primary purpose of a randomized controlled trial (RCT)?
- To maximize the statistical power of an experiment
- To eliminate confounding by randomly assigning subjects to treatment and control groups (Correct answer)
- To reduce the cost of data collection
- To ensure the sample is representative of the population
Correct answer: To eliminate confounding by randomly assigning subjects to treatment and control groups
Random assignment ensures that both observed and unobserved confounders are balanced across groups, enabling valid causal claims about the treatment effect.
Question 7: What does the silhouette score measure in the context of clustering?
- The number of clusters chosen by the algorithm
- How similar each point is to its own cluster compared to other clusters (Correct answer)
- The total within-cluster sum of squares
- The fraction of points correctly assigned to known labels
Correct answer: How similar each point is to its own cluster compared to other clusters
The silhouette score ranges from -1 to 1 and measures cohesion (intra-cluster distance) versus separation (nearest-cluster distance) for each point.
What is the purpose of the 'EXPLAIN' command in SQL?