Practice
Solution
Step 1: Understand the purpose of normalization.
Normalization scales the data to a range of [0, 1] and is useful when data is on different scales.Step 2: Eliminate wrong options.
When the data follows a Gaussian distribution. is incorrect because standardization is preferred for Gaussian distributions. When the data contains outliers. is incorrect because normalization is sensitive to outliers. When the model is sensitive to variance. is incorrect because standardization handles variance better.Final Answer:
Option A -> Option AQuick Check:
Normalize for non-Gaussian, different scales. [OK]
Solution
Step 1: Identify the role of each component.
Version control manages code, CI server automates testing, model registry stores models, data pipeline handles data flow.Step 2: Eliminate wrong options.
Version control (A) and CI server (B) don't handle data. Model registry (C) stores models, not data. Data pipeline (D) triggers retraining with new data.Final Answer:
Option B -> Option BQuick Check:
Data pipeline triggers retraining. [OK]
import numpy as np
from sklearn.model_selection import cross_val_score
from sklearn.tree import DecisionTreeClassifier
X = np.array([[1, 2], [3, 4], [5, 6], [7, 8]])
y = np.array([0, 1, 0, 1])
model = DecisionTreeClassifier()
scores = cross_val_score(model, X, y, cv=2)
print(scores)What does this code output?Solution
Step 1: Understand cross-validation output
Cross-validation with cv=2 splits the data into two folds, returning an array of two scores.Step 2: Eliminate wrong options
An error because the dataset is too small for cross-validation. is incorrect because the code runs without error. A single accuracy score for the entire dataset. is incorrect because cross-validation returns multiple scores. An array of four accuracy scores, one for each data point. is incorrect because the number of scores equals the number of folds, not data points.Final Answer:
Option A -> Option AQuick Check:
Cross-validation returns scores per fold. [OK]
Solution
Step 1: Compare Word2Vec and BERT
Word2Vec is less resource-intensive and faster than BERT, which is beneficial when resources are limited.Step 2: Eliminate wrong options
Options A, C, and D require deep contextual understanding, which BERT handles better than Word2Vec.Final Answer:
Option B -> Option BQuick Check:
Word2Vec for speed, BERT for context [OK]
Solution
Step 1: Identify the task requirement
Highly heterogeneous node importance suggests the need for attention mechanisms.Step 2: Compare GCN and GAT
GAT uses attention to weigh node importance, unlike GCN.Final Answer:
Option B -> Option BQuick Check:
Use GAT for node importance heterogeneity. [check]
