Practice
Solution
Step 1: Understand ROC computation
ROC curve computation involves sorting the scores, which is O(n log n).Step 2: Eliminate wrong options
O(n^2) is incorrect as it suggests quadratic complexity, O(n) suggests linear complexity which ignores sorting, and O(log n) is too low.Final Answer:
Option A -> Option AQuick Check:
ROC curve involves sorting, hence O(n log n) [OK]
Solution
Step 1: Identify the impact of centering data
Centering data is crucial for PCA as it ensures the covariance matrix reflects true variance.Step 2: Eliminate wrong options
Eigenvectors were not normalized. is incorrect because normalization affects direction, not variance. Covariance matrix was computed using rowvar=True. affects orientation, not variance. Too few principal components were selected. is irrelevant to the variance of the first component.Final Answer:
Option A -> Option AQuick Check:
Center data before PCA to capture variance. [OK]
Solution
Step 1: Identify the Cause of Similar Trees
Similar trees often result from insufficient randomness in feature selection.Step 2: Eliminate Other Causes
Too many trees (A) or high variance (D) don't cause similarity; too much data (C) affects overfitting, not similarity.Final Answer:
Option A -> Option AQuick Check:
Feature sampling adds diversity [OK]
Solution
Step 1: Consider memory optimization techniques
Using half-precision floating point reduces memory usage while maintaining sufficient precision for many applications.Step 2: Eliminate wrong options
Reduce the number of dimensions in the encoding. changes the model architecture. Use a sparse matrix for the encoding. is not applicable as the matrix is dense. Share the encoding matrix across multiple layers. may affect model performance and is not a direct memory optimization.Final Answer:
Option D -> Option DQuick Check:
Half-precision reduces memory without major precision loss. [OK]
Solution
Step 1: Identify Memory Optimization Techniques
Using smaller data types can significantly reduce memory usage.Step 2: Evaluate Options
Using a single tree (A) reduces model complexity, not memory; reducing features (B) affects accuracy; serialization (D) affects storage, not runtime memory.Final Answer:
Option B -> Option BQuick Check:
Smaller data types save memory [OK]
