Practice
import numpy as np
from sklearn.linear_model import LinearRegression
X_train = np.array([[1, 2], [2, 3], [3, 4]])
y_train = np.array([3, 5, 7])
model = LinearRegression().fit(X_train, y_train)
X_test = np.array([[4, 5], [5, 6]])
predictions = model.predict(X_test)
print(predictions)Solution
Step 1: Understand the impact of covariate drift.
Covariate drift affects the input distribution, leading to biased predictions.Step 2: Eliminate wrong options.
The model won't throw an error (The model will throw an error.) and predictions won't be accurate (The predictions will be accurate.) or unaffected (The predictions will be unaffected by covariate drift.) due to drift.Final Answer:
Option D -> Option DQuick Check:
Covariate drift biases predictions [OK]
Solution
Step 1: Compare GELU and ReLU characteristics.
GELU provides smoother gradients due to its probabilistic nature, which can help in convergence.Step 2: Evaluate each option.
GELU is not cheaper (A), doesn't entirely avoid dying neurons (C), and isn't more interpretable (D).Final Answer:
Option D -> Option DQuick Check:
GELU smooths gradients, aids convergence. [OK]
Solution
Step 1: Consider computational efficiency.
Filter methods are computationally inexpensive as they do not involve training models.Step 2: Eliminate wrong options.
Wrapper methods and recursive feature elimination are computationally intensive. Embedded methods require model training, which can be resource-heavy.Final Answer:
Option D -> Option DQuick Check:
Filter = low cost, no model. [OK]
Solution
Step 1: Consider dataset size and dimensionality
Approximate methods are beneficial for large, high-dimensional datasets.Step 2: Eliminate wrong options
When you have a small dataset with low dimensions. is incorrect as exact KNN is feasible. When you need exact results for a critical application. is wrong because approximate methods are not for critical exactness. When computational resources are unlimited. is incorrect as resources are not a constraint.Final Answer:
Option A -> Option AQuick Check:
Approximate for large, high-dimension data. [OK]
Solution
Step 1: Identify the need for prioritization.
When some entries are more important, prioritization is key.Step 2: Eliminate non-prioritization strategies.
Random (A) and Stratified (B) don't prioritize. Reservoir (C) handles size but not importance.Final Answer:
Option D -> Option DQuick Check:
Weighted = Prioritize important data [[check]]
