I knew random forests reasonably well going in but this question is basically five separate hard questions stapled together.
Start by clarifying requirements and constraints, then outline a modular design that addresses each component (CART, missing values, categorical splits, bagging, OOB, calibration, imbalance, parallelization, streaming). For each component, explain the algorithm, justify design choices, and provide pseudocode for train(), predict_proba(), and OOB evaluation. Conclude with complexity analysis and trade-offs.
Pro tip: Emphasize memory efficiency: use float32, sparse representations, and out-of-core processing where possible. Also, highlight that OOB evaluation can be used for early stopping and drift detection without a separate validation set.
Restate the problem: binary classification, 200k samples, 100 mixed features, 2GB memory. Confirm assumptions (e.g., feature types, missingness, class imbalance ratio) and discuss trade-offs (e.g., exact vs approximate splits).
Describe CART with Gini impurity, handling missing values via surrogate splits or probabilistic split, and categorical splits using sorted category grouping (e.g., by response rate) without one-hot encoding. Justify choices for memory and performance.
Explain bootstrap and feature bagging with reproducible seeds, OOB evaluation including ROC-AUC and PR-AUC, reliability diagram, and calibration methods (Platt scaling vs isotonic regression). Address class imbalance with 10x FN/FP cost ratio via class weights or threshold tuning.
Discuss thread-safe parallelization (e.g., parallel tree building with locks or atomic operations) and complexity analysis. Cover warm-start/streaming with concept drift detection using OOB metrics (e.g., monitoring OOB AUC over time).
Provide pseudocode for train(), predict_proba(), and OOB evaluation. Justify every design choice (e.g., why Gini, why surrogate splits, why isotonic regression for calibration). Summarize with complexity and memory analysis.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.