Skip to content
elevatedevco

Foundations & Concepts

Reference Notes

Learn Reference Notes: 3 practice questions and answers with an interactive quiz — from the offline AI Learning app.

Professional3 questions

Questions & Answers

Tap a question to reveal its answer. Written for self-study and interview preparation.

In practice, how do you decide between a bagging and a boosting ensemble for a tabular problem?

Use bagging (e.g., random forests) when your base learners are high-variance and you want to reduce variance without much tuning — it parallelizes well and is robust to noise and overfitting. Use boosting (e.g., gradient boosting, XGBoost, LightGBM) when you want to squeeze maximum accuracy by reducing bias, are willing to tune (learning rate, depth, regularization), and your data is fairly clean. Rule of thumb: start with a well-tuned gradient-boosted trees model for structured/tabular data; fall back to bagging when you see boosting overfit noisy labels.

What is a practical checklist for catching data leakage before it inflates your validation score?

Fit all preprocessing (scaling, imputation, encoding, feature selection) inside the cross-validation fold, never on the full dataset. Confirm no target-derived features (e.g., aggregates that include the row's own label) leak in. For time series, split chronologically and never let future rows inform past ones. Watch for identifiers or timestamps that proxy the target. If a single feature gives near-perfect accuracy, treat it as leakage until proven otherwise. Finally, keep a truly held-out test set touched only once at the very end.

When serving an ML model, why prefer shadow deployment before a full rollout?

A shadow deployment sends real production traffic to the new model in parallel with the current one, but the new model's predictions are logged rather than served to users. This lets you compare latency, resource use, and prediction distribution against the live model on real inputs, with zero user risk. You catch training-serving skew, feature-pipeline mismatches, and performance regressions before they affect anyone. Once shadow metrics look healthy, graduate to a canary (small % of live traffic) and then a full rollout.

Put it into practice with AI Learning

This topic — and hundreds more — comes from our free, offline AI Learning app. Practice Q&A, quizzes and cheat sheets anywhere, no account needed.

  • Free
  • No account
  • Works offline
Coming soon toGoogle Play