learntodriveai.dev/Data Science/Method-Driven Preparation and Leakage Prevention
Data ScienceProject 056 unitsVerified on 16 October 2026

Method-Driven Preparation and Leakage Prevention

Eunji ChoHead of Merchandising Analytics · Beauty retailer · Seoul, South Korea
Slack message · from Eunji
we have a demand forecasting problem and it's costing us real money. Q4 2025: 180M won in expired inventory write-offs + 250M won in missed sales from stockouts.
Chat with Eunji

What you hand back

  • A week-ahead demand forecast by SKU
  • Seasonal and trend-driven products split apart
  • A methodology memo with preparation decisions
  • Findings summary in buying-team language
  • A decision record for the key choice
  • Honest and leaking models compared side by side

6 units

  1. Unit 1: The Slack message and the data

    Set up the project, read Eunji's Slack message, and profile the sales and social media data.

    Open unit 1
  2. Unit 2: The leakage trap

    Catch the same-day mention leakage, build lagged features and a week-ahead target, and split the data by time.

    Open unit 2
  3. Unit 3: Feature engineering and preparation design

    Find stockout zeros and the May 2025 tracking gap, split seasonal from trend-driven products, and design the features.

    Open unit 3
  4. Unit 4: Build and evaluate the forecast model

    Fit the forecast model, measure MAE and RMSE by product type, and compare it with a deliberately leaking model.

    Open unit 4
  5. Unit 5: Translate and deliver to Eunji

    Complete the methodology memo, have a second model review it, and restate the forecast in buying language.

    Open unit 5
  6. Unit 6: Deliver, handle scope, and close

    Send the findings to Eunji, answer her request about predicting viral products, write the decision record, and push to GitHub.

    Open unit 6
Read the full brief

In Q4 2025 a K-beauty retailer in Seoul wrote off unsold stock on some SKUs and stocked out of others. You build a demand forecasting model from sales history and social media signals so the buying team can order the right quantities.

The discipline skills: engineering time-lagged features from social media data, enforcing temporal train/test splits, evaluating forecast accuracy with MAE and RMSE, and separating seasonal products from trend-driven products that need fundamentally different forecasting approaches.

The AI-direction lesson: until now, the data you received was ready to analyze or needed cleaning you could see. This time, the preparation decisions are where the analysis lives or dies. AI treats data preparation as generic cleaning -- random train/test splits on time-dependent data, same-day social media mentions as features, one-hot encoding everything. Each of those defaults produces a model that looks excellent and predicts nothing. The skill is questioning AI's preparation choices before you ever see a model result.

Your Role

You build the forecasting model, but the model is not the hard part. The hard part is preparing the data correctly. The analysis specification is less detailed this time. You decide what preparation steps are needed, what features to engineer, and how to split the data.

What's New

Last time, you built a classification model on imbalanced data, discovered that accuracy is meaningless when one class dominates, and learned to evaluate with precision, recall, and ROC curves. You caught a proxy feature and tuned a threshold to match the client's priorities.

This time, the data has a different kind of problem. The preparation decisions — which features to include, how to time them, how to split the data — are where the analysis lives or dies. A model trained on data that leaks future information will look excellent and predict nothing. This is not about building a better model. It is about preparing data that makes any model trustworthy.

The hard part is recognizing what is wrong with the data before you see it in the results.

Tools

  • Python 3.11+ via your conda "ds" environment
  • Jupyter Notebook for the analysis
  • pandas for data handling
  • scikit-learn for regression models, feature importance, MAE/RMSE
  • scipy for statistical checks
  • matplotlib / seaborn for visualization
  • Claude Code as the AI you direct
  • Git / GitHub for version control

Materials

You receive:

  • Two datasets: daily sales data (~145,000 rows, 200 SKUs over 24 months) and daily social media mention counts
  • A data dictionary explaining both datasets
  • A methodology memo template with a new "Preparation Decisions" section for documenting feature engineering, the train/test split, feature availability, and data quality decisions
  • A project governance file (CLAUDE.md) for Claude Code
  • Eunji's Slack message explaining what she needs
Materials · 6 files
Start Project 5

You work at a computer with a terminal. Signed in, your place is saved.