Data processing and features practice problems

29 problems · 0 solved

Before any model can learn, raw data has to be cleaned, split and turned into numbers. Most real model failures come from this stage, especially data leakage, where information from the test set sneaks into training. Think of it as preparing ingredients before cooking: bad prep spoils the dish no matter how good the recipe is. These problems focus on doing this prep correctly. You will standardise features without leaking test data, scale with the median and IQR to resist outliers, compute balanced class weights, use the hashing trick for categories, bin features into quantile buckets learned on training data, generate K-fold and stratified splits, split folds by user so no user lands in both sets, remove duplicate texts after normalising them, target-encode a category with smoothing, and fit a full imputation, scaling and one-hot pipeline. Start with the Easy problems on standardisation and class weights. Then do the splitting problems, and finish with grouped folds, target encoding and the full pipeline. Interviewers love leakage questions, and in real jobs careful splits and features often matter more than the choice of model.

Easy 14

Medium 9

Hard 6

Related topics

All practice problems