KatInterview

Defend a Tabular ML Project: Validation, Tuning, PCA, SHAP

Machine LearningModel answer

Last updated

Walk through one supervised ML project end to end, covering leakage, time-aware validation, feature choices and tuning, then derive PCA and explain SHAP and its pitfalls.

Choose one supervised machine learning project on tabular data that you have built yourself, and present it as if you had to justify every decision to a skeptical reviewer. Assume a feature matrix X with n rows and p columns, a target y (continuous or binary), and train/validation/test splits (time-ordered if the data is temporal). Your explanation should work for both an ML-literate peer and a non-technical stakeholder.

Cover the following five areas.

  1. Project framing. State the problem and business goal. Describe the data: size, schema, how and when the label is defined, the time span, and the main data-quality problems. Identify the leakage risks, describe your train/validation scheme (especially if the data is temporal), and name your primary metric(s) with the trade-offs they imply. Say which models you tried and why.

  2. Feature decisions. Explain how you chose which features to keep or drop: domain reasoning versus automated selection, handling of missing values, outliers and scaling, high-cardinality categoricals, correlated features, prevention of target and time-based leakage, and how you checked that features stay useful over time.

  3. Hyperparameter tuning. Name the hyperparameters that mattered most for your model, the search method and the metric you optimized, how you structured cross-validation (time-based or grouped where needed), how you used early stopping, how you avoided overfitting the validation set, and how you picked the final model.

  4. PCA. Write the core optimization objective and its solution. Relate it to the covariance matrix and to the SVD, say what the components mean, explain how you would choose the number of components, and discuss when PCA helps or hurts in a supervised task.

  5. SHAP. Explain what SHAP is and how it connects to Shapley values from cooperative game theory, including why it is considered "fair". State its key properties, explain how to read the summary (beeswarm), dependence and force plots, and list at least three pitfalls.

Hints

Hint 1

Pick a concrete project and fix the timeline first: when is the label known, when is each feature available, and do label windows overlap between adjacent rows? Most leakage questions follow from that.

Hint 2

For PCA, start from maximizing variance along a unit vector, write the Lagrangian, and you will land on an eigenvalue equation. Then substitute the SVD of the centered data to connect eigenvalues to singular values.

Hint 3

For SHAP, think of each feature as a player and the prediction as the payoff. Ask what happens to the attributions if features are correlated, or if you change the background (reference) dataset.