Practice
1. In the context of Graph Neural Networks, which component is primarily responsible for aggregating information from neighboring nodes?
easy
Solution
Step 1: Identify the role of each component
The message passing mechanism is designed to aggregate information from neighboring nodes in a graph.Step 2: Eliminate wrong options
Activation functions, dropout layers, and batch normalization do not specifically aggregate information from neighboring nodes.Final Answer:
Option C -> Option CQuick Check:
Message passing aggregates neighbor info in GNNs. [check]
Hint: Message passing aggregates neighbor info in GNNs. [check]
Common Mistakes:
2.
from sklearn.ensemble import RandomForestClassifier
import numpy as np
X = np.array([[1, 2], [3, 4], [5, 6], [7, 8]])
y = np.array([0, 1, 0, 1])
model = RandomForestClassifier(n_estimators=1, max_features=1, bootstrap=False)
model.fit(X, y)
print(model.estimators_[0].tree_.feature)What does this code output?easy
Solution
Step 1: Analyze the code
The RandomForestClassifier is set with max_features=1, meaning each tree considers only one feature for splitting.Step 2: Determine the output
Since bootstrap=False, the entire dataset is used, and the tree will choose one feature. The output shows the feature index used for splitting.Final Answer:
Option C -> Option CQuick Check:
max_features=1 limits to one feature. [OK]
Hint: max_features=1 limits to one feature. [OK]
Common Mistakes:
3. When should you prefer using LightGBM over XGBoost for a gradient boosting task?
medium
Solution
Step 1: Identify LightGBM's strengths
LightGBM is optimized for speed and performance on large datasets with high dimensionality.Step 2: Eliminate wrong options
When you need better accuracy on small datasets. is incorrect because XGBoost often performs better on small datasets. When interpretability of the model is the primary concern. is incorrect because neither LightGBM nor XGBoost is particularly interpretable. When you require a model that handles categorical features natively. is incorrect because both can handle categorical features, but LightGBM is faster on large datasets.Final Answer:
Option A -> Option AQuick Check:
LightGBM = Large, high-dimensional data [OK]
Hint: LightGBM = Large, high-dimensional data [OK]
Common Mistakes:
4. A fine-tuned model is underperforming on a specific task despite using a well-known pretrained model. What is a likely cause?
medium
Solution
Step 1: Identify common issues in fine-tuning.
Small task-specific datasets can lead to poor adaptation of pretrained models.Step 2: Eliminate wrong options.
The pretrained model was not trained on a large enough dataset. is incorrect because the pretrained model's dataset size is not the issue. The learning rate during fine-tuning was too high, causing overfitting. is incorrect because a high learning rate typically causes instability, not overfitting. The pretrained model's architecture is incompatible with the task. is incorrect because architecture incompatibility would prevent fine-tuning altogether.Final Answer:
Option D -> Option DQuick Check:
Small dataset? Poor fine-tuning. [check]
Hint: Small dataset? Poor fine-tuning. [check]
Common Mistakes:
5. In a real-time prediction system, how should you handle data splits to ensure both model performance and system efficiency?
hard
Solution
Step 1: Consider real-time constraints
Real-time systems need to adapt to new data while maintaining performance.Step 2: Evaluate options for adaptability and efficiency
Use a single train-test split to minimize latency. risks overfitting. Use a large test set to ensure model robustness. misallocates resources. Use a static validation set to simplify the system. lacks adaptability to new data.Final Answer:
Option D -> Option DQuick Check:
Rolling window adapts to new data efficiently. [OK]
Hint: Rolling window adapts to new data efficiently. [OK]
Common Mistakes:
