Data Science Data Science-DATA Science 1 — Questions and Answers
Question 1: Which measure of central tendency is most resistant to the influence of outliers?
- Mean
- Median (Correct answer)
- Mode
- Standard deviation
Correct answer: Median
The median is the middle value of a sorted dataset and is unaffected by extreme values, making it the most robust measure of central tendency when outliers are present.
Question 2: What is the primary purpose of cross-validation in machine learning?
- To speed up model training
- To assess how well a model generalizes to unseen data (Correct answer)
- To increase the size of the training dataset
- To remove outliers from the dataset
Correct answer: To assess how well a model generalizes to unseen data
Cross-validation partitions data into multiple folds and repeatedly trains/tests the model, giving a reliable estimate of how the model will perform on new, unseen data.
Question 3: In a neural network, what is the role of the activation function?
- To initialize the weights of the network
- To introduce non-linearity into the model (Correct answer)
- To normalize the input features
- To calculate the loss between predictions and labels
Correct answer: To introduce non-linearity into the model
Activation functions like ReLU or sigmoid introduce non-linearity, allowing neural networks to learn complex, non-linear relationships that a purely linear model could not capture.
Question 4: Which SQL clause is used to filter rows after a GROUP BY aggregation has been applied?
- WHERE
- FILTER
- HAVING (Correct answer)
- CASE
Correct answer: HAVING
HAVING filters groups produced by GROUP BY, whereas WHERE filters individual rows before aggregation occurs. HAVING is the correct clause for conditions on aggregated values.
Question 5: What does a confusion matrix's 'precision' metric measure?
- The proportion of actual positives correctly identified
- The proportion of predicted positives that are truly positive (Correct answer)
- The total accuracy across all classes
- The ratio of false negatives to true positives
Correct answer: The proportion of predicted positives that are truly positive
Precision = True Positives / (True Positives + False Positives). It measures how many of the model's positive predictions were actually correct, reflecting the cost of false alarms.
Question 6: Which data transformation technique scales features so they have a mean of 0 and a standard deviation of 1?
- Min-Max normalization
- Log transformation
- Standardization (Z-score scaling) (Correct answer)
- Binarization
Correct answer: Standardization (Z-score scaling)
Standardization subtracts the mean and divides by the standard deviation, producing a distribution centered at 0 with unit variance. This differs from Min-Max normalization, which scales values to a fixed range like [0, 1].
Which measure of central tendency is most resistant to the influence of outliers?