Practice
import numpy as np
X = np.array([[1, 2], [3, 4]])
weights = np.array([0.5, 0.5])
predictions = np.dot(X, weights)
print(predictions)Solution
Step 1: Calculate the dot product
The dot product of X and weights is calculated as follows: [1*0.5 + 2*0.5, 3*0.5 + 4*0.5] = [2.0, 4.0].Step 2: Eliminate wrong options
Options A, B, and D result from incorrect calculations of the dot product.Final Answer:
Option D -> Option DQuick Check:
Dot product: sum of element-wise products. [OK]
Solution
Step 1: Identify common causes of performance drop
Data drift is a frequent cause of unexpected performance drops.Step 2: Eliminate wrong options
The model's hyperparameters were not tuned properly. would cause issues from the start. The model architecture is outdated. is less likely to cause sudden drops. The training dataset was too small. affects initial performance, not sudden changes.Final Answer:
Option D -> Option DQuick Check:
Sudden drop? Check data distribution first [OK]
Solution
Step 1: Analyze the metrics
ROC-AUC can be misleading in imbalanced datasets as it doesn't focus on the minority class.Step 2: Eliminate wrong options
Overfitting (A) and underfitting (D) are not directly related to the discrepancy between ROC-AUC and minority class performance. High bias (C) would affect overall performance, not just minority class.Final Answer:
Option A -> Option AQuick Check:
ROC-AUC can mislead in imbalanced datasets. [OK]
Solution
Step 1: Identify the need for streaming data handling.
Streaming data requires a strategy that can update samples dynamically.Step 2: Eliminate non-streaming strategies.
Random (A) and Stratified (B) don't handle streaming efficiently. Weighted (D) is for prioritization, not streaming.Final Answer:
Option B -> Option BQuick Check:
Reservoir = Streaming data handling [[check]]
Solution
Step 1: Identify the stratified sampling requirement.
Stratified sampling requires correct class proportion specification.Step 2: Eliminate unrelated issues.
Random Sampling (B) would not be used if stratified was intended. Data leakage (C) affects model performance, not sampling. Sample size (D) affects variability, not imbalance directly.Final Answer:
Option C -> Option CQuick Check:
Check class proportions in stratified sampling [[check]]
