Data Preparation and Class Imbalance for ML Questions
Preparing training data and handling skewed or shifting distributions. Covers preprocessing and cleaning for model input, data augmentation, distribution shift, class imbalance techniques (resampling, reweighting, threshold tuning), and cold-start scenarios where labeled data is scarce. Focuses on the data-side decisions that determine whether a model can learn at all.
You have a multi-label classification problem where labels frequently co-occur and some labels are extremely rare, in some cases thousands of possible labels. Describe training strategies, loss functions, and sampling schemes that respect label correlations and improve detection of rare labels without destabilizing the common ones, plus how you would evaluate and scale this efficiently.
In scikit-learn, what is the difference between calling fit_transform on your training features and calling transform (not fit_transform) on your test features? Show the code, and explain concretely what information would leak into your evaluation if you fit the scaler on the combined train+test data instead.
Propose a data-collection strategy (not just a resampling strategy) to reduce class imbalance at the source for a churn-prediction product: targeted labeling triggers, instrumentation changes that let you capture more positive examples as they happen, and safeguards against introducing new sample-selection bias into the training data.
Why can naive random oversampling of the minority class cause overfitting? Describe three mitigation strategies and explain the mechanism by which each reduces the risk.
Why is feature scaling important before applying Principal Component Analysis (PCA)? Give a concise example (numeric or conceptual) showing how an unscaled dataset can produce misleading principal components, and describe when it might be acceptable to skip scaling before PCA.
Unlock Full Question Bank
Get access to all Data Preparation and Class Imbalance for ML interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.